Symfony

MIT
Platform
Linux Windows macOS
Licence
MIT Open source
Symfony

Overview

Symfony is a PHP framework and a set of reusable PHP components. Fabien Potencier released the first version in 2005 as a way to package the libraries he was already using, and that origin still explains how it works: the framework is assembled from decoupled components — HTTP kernel, routing, dependency injection, form, validator, mailer, console — which can be used on their own or together. The components are widely reused elsewhere: Laravel is built on several of them, and Drupal’s Drupal 8 and later releases are built on Symfony itself. Symfony is released under the MIT licence, with a new minor version every six months, LTS releases maintained for years, and the current stable line at 8.1.

Key Features

  • Components you can take one at a time — more than fifty standalone libraries, from HttpFoundation to Console, usable in any PHP project with Composer.
  • Dependency injection done properly — a compiled service container wires classes together from configuration, which keeps application code free of new chains and global state.
  • Symfony Flex — recipes configure bundles automatically when you install them, so a project starts minimal and grows only where it needs to.
  • Debugging tools — the web debug toolbar and the Profiler expose queries, routes, events, cache and timing for every request in development.
  • Environment parity — dev, test and prod share code and differ only by configuration, with cache warm-up and container compilation as explicit build steps.
  • A complete stack when you want it — Twig templating, Doctrine ORM, form and validation components, security with authenticators, the Mailer and Messenger queues, and API Platform for REST and GraphQL.
  • Long-term support — LTS releases (6.4 and 7.4 in the current cycle) receive security fixes for years, which is why it is common in enterprise and public-sector projects.
  • Tested and documented — PHPUnit integration, fixtures, a documented upgrade path and one of the most detailed framework documentation sets in PHP.

Why Use Symfony?

Symfony is what you reach for when a PHP application has to stay maintainable for years and more than one team will work on it. The service container makes dependencies explicit, the event dispatcher and kernel give every part of a request a defined place, and upgrades are published as documented paths rather than surprise rewrites — with BC promises between minor versions and LTS releases for the slow-moving projects. It also scales down: the same components that power a large Symfony application can be dropped into a legacy script to give it routing, a request object or a console. The learning curve is not small — configuration, bundles and the container take deliberate study, and a small CRUD site will feel like more framework than it needs. The trade-off is deliberate: less magic in exchange for a structure that survives contact with a real team and a long support window.

Use Cases

  • Business applications and APIs where structure, auditing and long support matter more than the fastest possible start.
  • REST and GraphQL APIs built with API Platform on top of Symfony.
  • Content platforms and e-commerce — Drupal, PrestaShop and Sylius all build on Symfony or its components.
  • Reusing individual components (Console, HttpFoundation, DomCrawler, Mailer) inside otherwise ordinary PHP projects.
  • CLI tooling written as Symfony Console applications and distributed as PHAR archives.
  • Enterprise systems with SSO, message queues and multi-tenant requirements, where the security and Messenger components do most of the work.

Getting Started

Install PHP and Composer, then create a project with composer create-project symfony/skeleton my-app (or the symfony CLI from symfony.com/download, which also provides symfony serve). Run symfony check:requirements to see which PHP extensions and versions the current framework version expects. Add what the project needs with Flex: composer require symfony/orm-pack, composer require symfony/twig-pack, composer require --dev symfony/profiler-pack. Routes are attributes on controller methods, services are autowired from the container, and configuration lives in config/. Read the official documentation at symfony.com/doc for the current version, and use bin/console for cache, database and debugging commands.

Explore More Categories

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.