Symfony is a free framework written in PHP.
Symfony offers fast development and management of web applications, making it easy to solve the routine tasks of a web programmer. It works only with PHP 5 and higher. It supports many databases (MySQL, PostgreSQL, SQLite or any other PDO-compatible database). The relational database information in the project must be linked to an object model. This can be done using the ORM tool.
It is possible to install this framework in several ways:
- With the Symfony Installer
- With Composer
Let's look at both options.
Symfony Installer
First you need to install the installer itself.
For Linux you need to enter the commands
sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony
sudo chmod a+x /usr/local/bin/symfony
Then create an application with the installer
symfony new my_project_name
where "my_project_name " is the name of your project, respectively.
Composer
For this method we need to install (if not already installed) Composer.
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
php installer
sudo mv composer.phar /usr/local/bin/composer
After installing Composer, we can install the application
composer create-project symfony/framework-standard-edition my_project_name
During the installation (or later) it will be possible to enter the data of the database
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 check the application by going to the folder with the application and running the embedded server
php bin/console server:run