📚 Encyclopedia

Servers & Hosting · updated 2026-11-23

Responding to a critical PHP security release (and what to do with an unpatchable server)

phpsecuritycvepatchingdnfappstreamremicentos-7end-of-lifeapache

How a pre-announced critical PHP release was handled across three machines: a supported server that could be patched the same day, an end-of-life server that could not be patched at all, and a desktop that did not matter. The case was "PHP2Shell" (CVE-2026-109618/109619), two unauthenticated remote-code-execution flaws fixed on 2026-10-21 in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, with no workaround. The general lesson: know where your PHP packages come from before the advisory lands, and when a machine cannot be patched, contain it instead of hoping.

Before the release

Where RHEL-family PHP comes from

Patching (supported server)

dnf update 'php*'
systemctl restart php-fpm httpd
php -v

Then run the smoke tests and curl every vhost for a 200. Restart php-fpm explicitly; it is separate from httpd on Alma 9 (Setting up an Alma Linux 9 LAMP server).

Containing an unpatchable end-of-life server

The old CentOS 7.7 server ran PHP 7.3.14 under mod_php. Nothing could be updated: CentOS 7 mirrors return 404, Remi's el7 repos are frozen, PHP no longer patches 7.3, and reports said the flaws went back to PHP 5.4. Building PHP 8 by hand on it would break the old apps. So PHP was switched off: 1. Disable the module: rename /etc/httpd/conf.modules.d/15-php.conf to 15-php.conf.disabled-<reason> and apachectl graceful (no dropped connections). 2. Block PHP source at the same time, or Apache serves .php files as plain text and exposes database credentials. A late-loading conf.d/zz-php-disabled.conf: apache <FilesMatch "\.(php|php[0-9]|phar|phtml|inc)$"> Require all denied </FilesMatch> Verify a known config file (e.g. a mysql_conf.php) now returns 403. 3. Check for an existing compromise: PHP files modified recently (find -name '*.php' -mtime -60), webshells, and whether suspicious 200s in the logs are real files or a framework's catch-all route. 4. List what breaks: check which domains still resolve to the old box (dig @1.1.1.1), and which of them were PHP. Static sites keep serving; PHP sites go to 403; directories whose .htaccess uses php_value turn into 500s. 5. Write down the revert (rename the conf back, delete the deny file, graceful) and the real fix: move live sites to the patched server (Moving a website to a new server without downtime) or retire them.

Gotchas

See also

Linked from

Sources: home memory (MEMORY.md, reference_old_server), tldr post #1816 (2026-10-21/22), capital-s memory, tldr post #1911