Search code examples
deploymentsymfony1symfony-1.4production-environment

Deploying symfony 1.4 site on the production server


I am following the Symfony Jobeet tutorial, day 22 to be precise where you deploy the website to the server. Specifically where they state that they will not install symfony on the server and to download the file directly from the symfony site itself. Not sure what this means, and the statement feels a little ambiguous to me:

For reference:

http://www.symfony-project.org/jobeet/1_4/Doctrine/en/22

Alternately, how did you guys go about setting up symfony [not the project] on the production server? Any other links that you would recommend since hosting the symfony on a previous server domain yielded no success with repeated 500 internal server errors

thanks!


Solution

  • I download the symfony source files into a separately version controlled repo via github.com called 'vendor'. Then I symlink the symfony version I wish to use, from my 'app' repo (separate repo from vendor). This allows me to easily switch to another symfony version, and makes it so I can publish symfony files without having to publish my actual app files.

    Something like:

    # Path to your files
    $ -> cd /home/src/web/app/projectname/current
    $ -> ls -la
    framework -> vendor/framework/symfony/1.4.16
    vendor -> /home/src/web/vendor/current/
    

    Then in your ProjectConfiguration.class.php file, you simply need to point the autoloader to the symlink you just created:

    <?php
    require_once realpath(dirname(__FILE__)) . '/../../framework/lib/autoload/sfCoreAutoload.class.php';
    
    sfCoreAutoload::register();
    

    Now, if a new version of symfony is released, you can download the source files, add them to your vendor repo, then go into your app repo and change the symlink to point to the new version. When you push to production, you would push the vendor repo and the app repo, or you can push the vendor repo separately.

    If you rather not involve version control, you could download symfony source files to the production server manually and still follow this setup. Also, I usually maintain 3 versions of symfony, in case I need to switch back to an older version.