Installing Symfony

How to install the Symfony framework on Linux.

Symfony is an open-source PHP framework for rapid web application development. It requires PHP 5 or higher and supports MySQL, PostgreSQL, SQLite, and any other PDO-compatible database.

Symfony

Framework can be installed in two ways: using the official Symfony Installer or using Composer.

Method 1. Symfony Installer

Install the installer:

sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony
sudo chmod a+x /usr/local/bin/symfony

Create a new project (replace my_project_name with your project name):

symfony new my_project_name

Method 2. Composer

Install Composer if it's not already installed:

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

Create a new project:

composer create-project symfony/framework-standard-edition my_project_name

During installation, Composer will prompt you for database and mail server settings:

Some parameters are missing. Please provide them.
database_host (127.0.0.1):
database_port (null): 3306
database_name (symfony): scotchbox
database_user (root):
database_password (null): root
mailer_transport (smtp):
mailer_host (127.0.0.1):
mailer_user (null):
mailer_password (null):
secret (ThisTokenIsNotSoSecretChangeIt):

You can leave these blank and configure them later.

Verifying the installation

Navigate to the project directory and start the built-in server:

cd my_project_name
php bin/console server:run

Open your browser and go to http://localhost:8000 — the application should load.

Help

If you have any questions or need assistance, please contact us through the ticket system — we're always here to help!

Need help?Our engineers will help you free of charge with any question in minutesContact us