install symfony ubuntu

To install Symfony on Ubuntu, follow these steps:

  1. Update the system: Open a terminal and run the following command to update the system packages:
sudo apt update
  1. Install PHP: Symfony requires PHP to run. Install PHP and its extensions by running the following command:
sudo apt install php php-cli php-mbstring php-xml php-intl php-mysql php-pgsql php-sqlite3 php-zip php-curl
  1. Install Composer: Composer is a dependency manager for PHP. Install Composer by running the following commands:
sudo apt install curl
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
  1. Install Symfony CLI: Symfony provides a command-line interface (CLI) tool for managing Symfony projects. Install Symfony CLI by running the following command:
wget https://get.symfony.com/cli/installer -O - | bash
sudo mv ~/.symfony/bin/symfony /usr/local/bin/symfony
  1. Create a new Symfony project: Navigate to the directory where you want to create your Symfony project. Run the following command to create a new Symfony project:
symfony new my_project_name --full

Replace "my_project_name" with the desired name for your project.

  1. Start the Symfony development server: Change into the project directory by running the following command:
cd my_project_name

Replace "my_project_name" with the name of your project.

Start the Symfony development server by running the following command:

symfony server:start

Congratulations! Symfony is now installed on your Ubuntu system. You can access your Symfony project by opening a web browser and navigating to http://localhost:8000.