Symfony is a mature PHP framework and a set of reusable components maintained by SensioLabs alongside a large open-source community. It sits around #23 (tied) in web framework usage at roughly 4% share, but its influence runs deeper than that number suggests โ many of Symfony's components are used inside Laravel and other PHP projects under the hood, making it foundational to the modern PHP ecosystem even for developers who never touch it directly. Teams choose it for its strict conventions, dependency injection container, and long-term enterprise support.
Symfony controllers use PHP attributes to declare routes directly above the action method, keeping routing colocated with the code that handles it.
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class ProductController
{
#[Route('/products/{id}', name: 'product_show', methods: ['GET'])]
public function show(int $id): Response
{
return new Response(
"Product #" . $id
);
}
}
Symfony ships its own CLI installer that scaffolds a new project with a skeleton or full webapp structure.
# install the Symfony CLI, then create a new webapp
symfony new my_project --webapp
# start the local dev server
cd my_project
symfony server:start