Get started with Symfony 6 for beginners
--
A few months ago, I was required to start learning the “Symfony” framework for PHP. There are enough tutorials about Symfony 5 and 4. Upon deeper investigation, I decided to start with the latest version, which is the 6th. I must confess I was overwhelmed at the start, mainly because there are not enough resources for Symfony 6. The official documentation of it is very robust and well organized but it can be overwhelming for a beginner such as myself. So, one thing led to another, and I decided to start the series of Symfony 6 tutorials for beginners. This is the very first part of the series and will cover the perquisites, requirements, dependencies, and how to create the first Symfony 6 application.
Step 1 is installing required dependencies and technical requirements.
Firstly, PHP 8.0.2 or higher is required for Symfony 6. If needed, you must upgrade it to the latest stable version.
Also, we need Composer. Composer is the package control for PHP. For installing it click here.
We will use the CLI (Command Line Interface) tool for Symfony. CLI is a developer tool that you can build, run, and manage your Symfony application directly from the terminal of your choice. It is open source and works on the 3 most used operating systems that are Microsoft’s Windows, Apple’s macOS, and Linux. We will use Symfony CLI for creating new applications and developing applications with a local webserver (I am using XAMPP, but the alternatives can be chosen as well).
Keep in mind I am currently on a Windows machine, so this tutorial is for Windows.
For installing Symfony CLI, we need Scoop. Scoop is a command-line installer for windows. If you haven’t installed the scoop before following the steps to install the scoop.
Step 1: Open PowerShell. You can do this by searching for PowerShell in the start menu.
Step 2: Inside PowerShell, type the code below:
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Step 3: Type the line below:
iwr -useb get.scoop.sh | iex
From https://scoop.sh/
Step 2 is Installing & Setting up the Symfony Framework.