Deploying Symfony on Production Server

airplane in he runway

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

mkdir /apps

2. Pushing your code to production server

You can use FTP client like filezilla or cyberduck and put your code in /apps
If you are using git, then you can clone your app like this

cd /apps
git clone https://username@bitbucket.org/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://username@github.com/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

free -m

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

sudo reboot

If not, check if swapping is enabled and allow swapping if not.

See part two of symfony application deployment to the server

Using Facebook API to post articles from PHP

Post to Facebook From app – Using PHP

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

3 Comments
  1. Dennis

    Nice points indeed, thank you.

  2. marvel contest of champions hack tool

    It’s challenging to find knowledgeable folks on this topic, but you seem like you understand what
    you’re talking about! Thanks

  3. Luann

    This really replied my problem, thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*