9951 explained code solutions for 126 technologies


php-symfonyHow to deploy a Symfony application?


Deploying a Symfony application is a straightforward process.

  1. Install the Symfony CLI tool:
$ curl -sS https://get.symfony.com/cli/installer | bash
  1. Create a Symfony project:
$ symfony new my_project
  1. Configure the web server:

    • Create a virtual host for the project
    • Set the document root to the public directory of the project
    • Configure the web server to use the app.php file as the front controller
  2. Install the dependencies:

$ cd my_project
$ composer install
  1. Clear the cache:
$ php bin/console cache:clear

Your Symfony application is now ready to be deployed.

Helpful links

Edit this code on GitHub