PHP 8.5 on E-01: installing the core without starting FPM automatically

A verified package source, PHP 8.5.12 and preserved startup restrictions: prepare the core on an educational VPS before configuring its pool.

A mechanical assembly, a parcel and a switch in a workshop.

After checking the resources, I moved on to installing PHP on the learning E-01 itself. Nginx is already running here, but results from the previous test virtual machines do not mean PHP-FPM is already prepared on this VPS. This step has a narrower goal: obtain PHP 8.5.12 and the necessary core packages without starting the default FPM service before configuring it separately.

For the actual run, I used the existing CLI with separate stages for preparing the foundation, refreshing indexes and installing packages. The manual commands below are examples for reproducing the principle with standard Debian tools, not a raw log of this run.

The package source and trust in its key come first

For PHP, I use the packages.sury.org repository. Before installation, I need to identify both the source address and the key APT may use to verify its signature. The key is checked against an agreed source and stored in a separate keyring. The provider’s instructions are available in the PHP repository README.

On E-01, the source is recorded in the separate file /etc/apt/sources.list.d/solution200-php.sources:

Types: deb
URIs: https://packages.sury.org/php/
Suites: trixie
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/solution200-php.gpg

The key for this source is stored in /etc/apt/keyrings/solution200-php.gpg. The separate new source file does not replace existing APT configurations. Signed-By limits verification of this specific source to the selected key; it is not a suggestion to add a third-party key to the global trust of all repositories. A valid signature still does not select the required version or guarantee that a package suits the application.

In this continuation, I reused an already verified public keyring. Obtaining and checking it against the provider’s instructions is a separate prerequisite for an initial setup.

Refreshing indexes does not install PHP

sudo apt-get update

This command refreshes local information about available packages. It does not mean PHP is already installed. After reading the signed metadata, I separately checked the candidates and the proposed installation set on E-01 itself. The difference between update and install is explained in the apt-get manual.

One exact version was selected for the four PHP packages:

PackageVersion
php8.5-cli8.5.12-1+0~20261021.27+debian13~1.gbp1a3e8a
php8.5-common8.5.12-1+0~20261021.27+debian13~1.gbp1a3e8a
php8.5-fpm8.5.12-1+0~20261021.27+debian13~1.gbp1a3e8a
php8.5-readline8.5.12-1+0~20261021.27+debian13~1.gbp1a3e8a

The digits within the revision are part of the technical package version, not the time when I performed these actions. PHP itself returns the shorter version 8.5.12; its release is described in the official PHP announcement.

Installing a package does not mean allowing its service to start

Package scripts may try to start or restart a service during installation. I do not want the default FPM pool to begin serving requests before separate users, sockets and memory limits have been chosen. The start restriction is therefore prepared before changing packages.

Two different mechanisms are used here. A persistent PHP-specific /usr/sbin/policy-rc.d returns 101 for the vendor PHP8.5-FPM and session maintenance units, denying the corresponding start requests through the Debian service-policy mechanism. For other unit names, the policy returns 0: it is not a blanket ban on starting every service. This protection remained in place after installation; an unknown existing policy-rc.d is not overwritten. Its purpose is explained in the Debian manual for invoke-rc.d.

Separately, persistent masks remain on three default units. An example manual step before installation:

sudo systemctl mask php8.5-fpm.service phpsessionclean.service phpsessionclean.timer

A mask is stronger than disable: a unit cannot be started through an ordinary systemd request until the mask is explicitly removed. This distinction is described in the systemctl manual. This does not configure the future application pool: that requires a separate step.

Four selected packages and six new installations

Dependencies expanded the installation to six new packages: libargon2-1 and php-common were added to the four PHP packages. The combined size of the six archives is 6659804 bytes. This is the download size, not RAM usage or the final space required after unpacking.

An installation example with an explicit version, after preparing the start protection:

VERSION='8.5.12-1+0~20261021.27+debian13~1.gbp1a3e8a'
sudo apt-get install --no-install-recommends \
  php8.5-cli="$VERSION" php8.5-common="$VERSION" \
  php8.5-fpm="$VERSION" php8.5-readline="$VERSION"

On E-01, installation completed with these four exact PHP versions. I read the interpreter version without build timestamps:

php8.5 -r 'echo PHP_VERSION,PHP_EOL;'
dpkg-query -W php8.5-cli php8.5-common php8.5-fpm php8.5-readline

The first invocation returns 8.5.12; the second shows the full package revisions. These are two related but different ways to check what is installed.

After the operation, the CLI read the state again through a new SSH connection. This matters to me: completion of the installation process and a fresh independent read are different actions. The new connection checks the installed versions and retained start restrictions rather than simply repeating the last line of the previous command. A mismatch would stop further progress, not become a reason to repeat the installation automatically.

A fresh read after installing PHP8.5.12: vendor FPM and session cleanup units are masked; Nginx is active. Exit1 belongs to the mask check.

Why masked with exit code 1 is expected here

systemctl is-enabled php8.5-fpm.service phpsessionclean.service phpsessionclean.timer
systemctl is-active nginx.service

For the three units, I received masked, and the first command’s overall exit code was 1. This is the expected response about the masks, not a message that package installation failed. I do not replace the code with zero: I read it alongside the actual response lines.

Nginx remained active and its master PID did not change. The default FPM service was not started; a separate application pool has not been configured yet. This step did not deliver Symfony to the server. The result is an installed PHP core with controlled service startup, not a finished site or open public access.

  1. Operations & Security Controlled PHP 8.5 installation on Debian 13
  2. Operations & Security Two PHP-FPM pools: separate UIDs, Unix sockets and file rights
  3. Observability E-01 resources before public access: RAM, disk and swap
  4. PHP Private PHP-FPM on E-01: a pool, socket and startup