Article
Patching php2shell across a mixed PHP fleet
When the php2shell fixes came out last week, the servers we look after were running PHP branches from 5.3 to 8.4. This is how we patched each one without moving any site to a new branch, and how we tested that the fix was actually in place.

The PHP project released fixes for two critical vulnerabilities at 14:00 UTC on 21 October, which was one o'clock in the morning on 22 October in Sydney. By that morning, clients were asking whether their websites were affected. Most of them were, because almost every site we host or maintain runs PHP somewhere, including sites that look entirely static from the outside.
The two vulnerabilities are CVE-2026-109618 and CVE-2026-109619, which have been nicknamed php2shell. The PHP Foundation's write-up describes both. The first is memory corruption when a request hits PHP's memory limit at exactly the wrong moment. On Apache with mod_php, an unauthenticated request can trigger it before any application code runs. The second is stale global state: a fatal error can leave internal state pointing at memory from a previous request, and a later request handled by the same worker can use that freed memory. Both can lead to remote code execution. The fixed releases are 8.5.12, 8.4.27, 8.3.36 and 8.2.35, and the PHP security team published minimal source backports for 7.4 through 8.1.
The fleet was the hard part. Across the servers we look after, the PHP versions ran from 5.3 to 8.4, installed in different ways: distribution packages, a third-party package archive, a custom build, and one version old enough that nothing current applies to it. Some ran PHP under Apache's mod_php, others under PHP-FPM behind Nginx. A single command to "update PHP" didn't exist for most of them, and on a production server running sites that depend on a particular PHP version, moving to a new branch was never an option in the middle of an incident.
We did most of the work with an AI agent over 22 and 23 October, with sub-agents working on separate servers at the same time and me deciding what happened on each one. This article goes through the order we did things in, the checks that turned out to matter, and the places where the first answer wasn't good enough. Servers and clients aren't named here. The PHP versions and the method are the useful part.
On X
Got a take on this?
Share it on X. I read the replies.