Deploying Symfony on Production Server
Time to ship your symfony app to production? Here are some flight checks. Lets assume your symfony app is in folder symfony-app
1. Don’t put Symfony app in the public accessible folder on your server
If your servers public facing folder is, say, /var/www/html, then don’t put the whole symfony folder there.
Choose another deeper and non-public facing folder. Let say /apps/symfony-app. I will list how you would put the public facing folders later.
For this to happen run this command on your server
2. Pushing your code to production server
cd /apps git clone https://email@example.com/username/symfony-app.git symfony-app
The above is assuming if you have your repo in bitbucket, if you have it in github
git clone https://firstname.lastname@example.org/Repository-Name-Here/scripts.git
You will be asked for password in both case unless you ssh setup for the server. But this would work for this purpose anyway.
** If you are getting any permission issues, use sudo in front of all the commands
3. Preparing production environment for composer
First get composer and make global as illustrated here if you don’t have it already.
Composer would require a bit more than 1G of memory size as I have seen it, so check if your memory on the server is good enough for this by running
If it short of 1G, you can cleanup a bit of memory. Just reloading the server, if that won’t create any problem would take care of some caching and other resident stuffs for you
If not, check if swapping is enabled and allow swapping if not.
See part two of symfony application deployment to the server
connect to sftp from php
fos user bundle security validation
$_POST vs $HTTP_RAW_POST_DATA vs php://input and enctype
how to deploy symfony application to the production server
Run single phpunit test