Install Symfony

Contents
The symfony CLI
symfony new blog --webapp
Start the server
Open the welcome page

The symfony CLI

The Symfony CLI is a small helper program that creates projects, runs a local web server, and checks that your machine meets the requirements. Install it once from the official download page, then use it for every project in this course.

Show the CLI version

symfony --version

Symfony CLI version 5.10.0

Any recent 5.x version works for this course. If the terminal answers command not found, the install step above did not finish.

symfony new blog --webapp

One command scaffolds a full project with Twig, Doctrine, forms, and validation preinstalled. The last word is the folder name, so this project will live in a folder named blog:

Create a new project named blog

symfony new blog --webapp

[OK] Your project is ready in the blog folder

The webapp option pulls in the most common packages at once. Later lessons introduce each of them one by one.

Start the server

Move into the new project folder first. The server must start inside the project so it finds the configuration and the public folder:

Start the local server inside the blog folder

symfony server:start

[OK] Web server listening on http://127.0.0.1:8000

Leave that terminal open while you work. Press Ctrl+C when you want to stop the server.

Open the welcome page

Open http://localhost:8000 in a browser. The Symfony welcome page means the install worked and the server sees your project.

If the browser cannot connect, check that the server terminal is still running and that you opened the project folder before starting it.

Next: Your first page

Article author: Arthur Isaev

Related articles
Development with PHP
What is Symfony and where it runs
Install Symfony
Your first page
Routes
Controllers
Twig basics
Twig advanced
Doctrine setup
Entities
Migrations
Repositories
Relations
Forms
Validation
Services and DI
JSON controllers
Serializer
Security intro
Users
Login form
Voters
Console commands
Events
Messenger
Mailer
Cache
Sessions
CSRF
Translations
Dotenv and env
Profiler
Testing
Fixtures
Pagination
File uploads
API Platform in one lesson
DQL
Transactions
Migrations advanced
Security advanced
HTTP client
Scheduler
Webhooks
Asset Mapper
Deployment
Performance
Capstone: blog
Capstone: JSON API
Modern Symfony tour
Hero roadmap: the whole course on one page

Search this site

Channel @aofeed Chat @aofeedchat

Contacts and cooperation:
I recommend our hosting beget.com
Write to info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: