This is an old revision of the document!
Table of Contents
Update PHP version
To run newer PHP versions on Debian than what is provided in your stable release's official repositories, use the third-party repository maintained by Ondřej Surý. This trusted community repository provides concurrent, up-to-date PHP packages (from legacy releases up to newer builds like PHP 8.4 or 8.5) for all active Debian distributions.
Secure existing config
List existing PHP packages
This step only applies when upgrading an existing PHP setup. The following command lists all installed PHP packages with the text php in its name, shows it on screen, and writes it to a file called packages.txt. This file comes in handy at a later step when installing the PHP 8.4 packages, to ensure the same list of PHP 8.4 versions of the extensions are installed.
dpkg -l | grep php | tee packages.txt php8.2-apcu/oldstable,now 5.1.22+4.0.11-2 amd64 [installed,automatic] php8.2-bcmath/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-bz2/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-cli/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-common/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-curl/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-fpm/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-gd/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-gmp/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-igbinary/oldstable,now 3.2.13-1 amd64 [installed,automatic] php8.2-imagick/oldstable,now 3.7.0-4 amd64 [installed,automatic] php8.2-intl/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-mbstring/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-memcached/oldstable,now 3.2.0+2.2.0-4 amd64 [installed,automatic] php8.2-msgpack/oldstable,now 1:2.2.0~rc2-3 amd64 [installed,automatic] php8.2-mysql/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-opcache/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-readline/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-xml/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic] php8.2-zip/oldstable-security,now 8.2.33-1~deb12u1 amd64 [installed,automatic]
php.ini
Save the old: /etc/php8.2/php.ini
www.conf
Save the old: /etc/php/8.2/fpm/pool.d/www.conf
