article --summary
The summary
The PHP2Shell pair of flaws in the PHP engine lets an unauthenticated caller execute code on any server handling PHP requests, and CISA has already listed both as known exploited. PHP 8.2 through 8.5 have fixed releases that install without code changes, but PHP 8.1 and older will never get a patch, so those applications must move to 8.4 or 8.5 first. Legacy code often breaks on newer PHP, which makes the upgrade the real obstacle.
The guide walks through three stages: continuous modernization scans your repositories for end-of-life runtimes, a managed transformation rewrites the code and checks it on a patched PHP, and you then update and restart the runtime itself. A sample PHP 7.4 application shows the kinds of breakage to expect, including removed functions and silent behavior changes that only tests reveal. You need the AWS Transform CLI, Docker or a patched PHP, and a disposable machine, because the agent runs commands unattended.
Editorial note: This is a summary of an article first published by AWS DevOps Blog. The full piece is on their site.