Deployment of Symfony2
Steps to move Symfony 2 project to hosting manually
It depends on kind of hosting that you have:
-
If you have SSH console, then you can do it on hosting after step 2, if you haven’t then do it locally: run command
php app/console cache:clear --env=prod'. -
Suppose you have on you hosting folders
youdomain/public_html, so inpublic_htmlmust be located all web files. So you must upload all from Symfony project (folders:app,src,vendors,bin; files:deps,deps.lock), except for folderwebin folderyoudomain. Everything from folderwebupload to folderpublic_html. -
Check CHMOD for folders
app/cacheandapp/logs, there should be write access. -
If there is no file .htaccess in public_html, then create it and add such code in it: https://raw.github.com/symfony/symfony-standard/master/web/.htaccess
-
Now you should use
youdomain.com/indexinstead ofyoudomain.com/app_dev.php/index, that you use locally. If a site still did not works, you can open fileweb/config.phpand find a code where a check for IP performs, you find there only IP127.0.0.1. Add your current IP to this list and upload new config on the server. Then you can open pathyourdomain/config.phpand check what’s wrong. Ifconfig.phpshows that everything ok, but it still didn’t work, you can enableapp_dev.phpto debug: openapp/app_dev.phpand your IP the same way as inconfig.php. Now you can run scripts as locally usingapp_dev.php.