To create a new Symfony project, you can use the Symfony Installer or Composer. Here are the steps for both methods:
Using Symfony Installer:
$ sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony
$ sudo chmod a+x /usr/local/bin/symfony
$ symfony new project_name
Replace project_name
with the desired name of your project.
Using Composer:
Install Composer if you haven't already. You can download Composer from https://getcomposer.org/download/.
Create a new Symfony project using Composer by running the following command:
$ composer create-project symfony/skeleton project_name
Replace project_name
with the desired name of your project.
$ composer create-project symfony/website-skeleton project_name
Replace project_name
with the desired name of your project.
After creating a new Symfony project, navigate to the project directory and start the Symfony development server by running the following command:
$ cd project_name
$ symfony server:start
You can then access your Symfony project in a web browser by visiting http://localhost:8000
.