Verify PHP-FPM before handing over to Nginx

Verify live PHP-FPM together with the complete original package history. A controlled service stop shows why installed packages do not prove runtime readiness.

An open and a closed path to the PHP service above an unchanged package chain.

Nginx needs a working PHP-FPM backend for PHP requests. Installed packages are insufficient: the service may be down while its retained activation record remains. On a separate local Debian VM, we verify active PHP-FPM, deliberately stop it and compare CLI responses. We use the local development version of the CLI.

What we prepared on the VM

We complete kernel preparation, the first reboot, administrator access and utility installation. We then install Nginx and PHP 8.5.12, create separate application users and directories, apply PHP-FPM configuration and start it through its approved CLI operation. This activation keeps automatic startup disabled.

The complete history contains seven package records: two original root records, two utility records and three Nginx/PHP records. The first reboot and PHP repository setup have two separate boundary proofs. Adding the PHP check preserves this complete original path.

The check before handing over to Nginx

We add the explicit PHP-FPM activation reference to the history check. PHP_ACTIVATION_REFERENCE selects the original activation plan and its completion fingerprint. Other variables are private paths to the same original approvals, console evidence, configuration and public repository key. Passwords and private key contents stay out of the command line.

deploy-cli host runtime-history prepared-inspect \
  --root-env-file "$ORIGINAL_ROOT_ENV" \
  --administrator-env-file "$ADMIN_ENV" \
  --request-file "$FIRST_POSTBOOT_REQUEST" \
  --references-file "$RUNTIME_REFERENCES" \
  --fpm-file "$FPM_PROFILE" \
  --key-file "$PUBLIC_REPOSITORY_KEY" \
  --key-sha256 "$PUBLIC_REPOSITORY_KEY_SHA256" \
  --php-activation-file "$PHP_ACTIVATION_REFERENCE"

The command reads the full history and actual PHP-FPM state. It checks original initialization before and after the read. The root profile admits original approvals locally; all remote reads use the administrator and sudo. The check starts no service and creates no history record.

Actual response with PHP-FPM running

These are selected fields from the actual CLI response. It retains seven records and two boundaries and verifies PHP-FPM activation. A confirming read also passed.

{
  "status": "passed",
  "write_performed": false,
  "checks": {
    "PHP_activation": "verified",
    "access_role": "administrator",
    "boundary_count": "2",
    "initial_preparation": "retained",
    "initialization": "verified",
    "node_count": "7",
    "proof_sha256": "e5040cb8bbfcf781862c587ec914d64f36ff813792ef9eeb862e4c7c6abb939f",
    "whole_host_ready": "false"
  }
}

Stopping the service changes the result

Only on the test VM, we deliberately stop the managed PHP-FPM service as a separate fixture operation. The following interactive command targets the fixture’s managed unit. We do not replay the original activation operation.

sudo -k -- systemctl stop deploy-cli-php85.service

With the same approvals, the Nginx preflight now refuses. Its retained successful activation record does not replace current service state:

{
  "status": "failed",
  "write_performed": false
}

The package-only history read still passes. Packages and their history remain intact while the service is stopped. These checks prove different facts:

{
  "status": "passed",
  "write_performed": false,
  "checks": {
    "access_role": "administrator",
    "boundary_count": "2",
    "initial_preparation": "retained",
    "initialization": "verified",
    "node_count": "7",
    "proof_sha256": "e5040cb8bbfcf781862c587ec914d64f36ff813792ef9eeb862e4c7c6abb939f",
    "whole_host_ready": "false"
  }
}

We also verified refusals for an incorrect PHP activation fingerprint, incorrect initialization completion and a pending package operation. After another reboot, a new serial-console observation confirmed the current boot and the complete history remained intact. Automatic service startup requires its own verification.

An unknown outcome stops the sequence

Separate initial fixture runs stopped while fetching data from the Debian CDN. These selected fields show the actual metadata-refresh result on one of them:

{
  "status": "failed",
  "completed_stages": 1,
  "host_write_attempted": true,
  "host_write_performed": true,
  "host_write_state": "unknown",
  "blocked_stage": "refresh",
  "whole_host_ready": false
}

The coordinator did not advance. We retained the failed VM states and did not replay their operations. The successful run used a separate clean VM. TLS and repository signature verification remained enabled. The CLI controller sets Acquire::Retries=0; retry settings in the initial VM configuration do not override it.

The frame shows a genuine VTE terminal summarizing saved results. It is a summary of the actual local run rather than raw command output. Capture repeats neither service activation/stopping, installation nor reboot. The complete automatic wizard remains a separate next stage.

PHP-FPM verification before Nginx on a local VM
  1. Platform Engineering PHP-FPM and OPcache: checking a pool’s effective settings
  2. Platform Engineering Server preparation history after another reboot
  3. Platform Engineering Waiting for SSH before continuing server setup
  4. Platform Engineering Original server preparation in Nginx and PHP history
  5. Platform Engineering PHP-FPM autostart: firewall and verification after reboot