Skip to content

php

installation

lastest on debian

# apt install php-common php-curl php-fpm php-gb php-intl php-xml php-zip

previous versions

$ wget https://packages.sury.org/php/php.gpg -O php-sury.gpg
# gpg -o /etc/apt/trusted.gpg.d/php-sury.gpg --dearmor /home/<USER>/php-sury.gpg
# echo "deb https://packages.sury.org/php/ bookworm main" > /etc/apt/sources.list.d/php-sury.list
# apt update
# apt install php8.1-cli php8.1-common php8.1-curl php8.1-fpm php8.1-gb
# apt install php8.1-intl php8.1-xml php8.1-zip
# apt install php8.1-pgsql
# apt install php8.1-xdebug

Symfony

Architecture

Routes
Controller

Minimal, just a link between Route and Service: receives a request, calls a service, generates a response. Handles forms, views, redirects...
Usually inherits AbstractController

Service

Class that encapsulates a business logic.
Is instanciated within a global Container (service is registred).