AWS Transform can help you analyze and upgrade legacy PHP code, but it does not patch the runtime already serving your application. To address PHP2Shell, prepare and validate the code, then update the deployed PHP runtime and restart its processes. AWS’s walkthrough separates those operations.

Treat code transformation as preparation for the runtime update—not as the update itself.

PHP2Shell and the PHP versions with fixes

AWS uses PHP2Shell to refer to CVE-2026-109618 and CVE-2026-109619. AWS assigns each a CVSS v4.0 score of 9.2 and says either vulnerability can let an unauthenticated caller execute code on a server handling PHP requests. The first fixed releases AWS lists are branch-specific:

PHP branchAffected releasesFirst fixed release
PHP 8.58.5.0–8.5.118.5.12
PHP 8.48.4.0–8.4.268.4.27
PHP 8.38.3.0–8.3.358.3.36
PHP 8.28.2.0–8.2.348.2.35

AWS says PHP 5.4 through 8.1 have no PHP release that fixes these vulnerabilities. For those branches, its guide recommends moving legacy code to PHP 8.4 or 8.5, while checking whether a distribution or long-term-support vendor supplies backported fixes for the older branch. AWS describes PHP 7.4–8.1 source backports as a stopgap for teams building PHP from source.

The distinction that drives the workflow is simple: upgrading a repository changes code; patching the deployed runtime changes what executes on the server. You need the latter for the running system to receive the PHP2Shell fix.

The workflow: analyze, transform, then patch the runtime

A repository flows through code analysis and transformation, then validation on patched PHP; a separate path leads to patching the deployed runtime and restarting PHP processes.

AWS’s process has three stages: analyze repositories, transform and validate code, then patch the deployed runtime and restart its PHP processes. The first two prepare the application for an updated PHP branch. The final operation addresses the vulnerable runtime.

Prepare a safe working environment

Before running the transformation, AWS lists AWS Transform CLI 3.20.0 or later, Node.js 22 or later, Git, jq, suitable AWS access, and either Docker or PHP from the patched target branch on the machine doing the transformation. AWS also recommends a disposable machine and throwaway repository clones: the agent runs commands using trusted tools, so do not give it production credentials.

Choose a target branch with a fixed release, and make sure you can test the application and review the resulting changes. AWS’s sample uses PHP 7.4 code with five small classes and seven PHPUnit tests; those details describe its example, not a template for your application.

Analyze repositories and prepare the branch

  1. Run the rapid analysis. AWS says this analysis reads composer.json to identify end-of-life PHP. In its sample description, it took 1–2 minutes per repository.
  2. Run the comprehensive analysis. This scan reads the code and can surface silent behavior changes—changes that may not produce an error. AWS gives 5–10 minutes or more as the sample duration. In its PHP 7.4 example, rapid analysis returned one high-severity PHP Version Upgrade finding; comprehensive analysis returned 6–11 findings, depending on the run. These are sample results, not expected counts for another codebase.
  3. Return to the working branch. Remove the generated ATXDocumentation folder and confirm the working tree is clean before starting remediation.

The two scans serve different purposes. Reading composer.json can flag the old PHP requirement; reading the source code can reveal compatibility changes that a dependency declaration alone would miss.

Transform the code and review the changes

  1. Create remediation for the selected findings. AWS describes using the managed AWS/php-version-upgrade transformation to move legacy code to a supported PHP branch. Keep --transformation-name and -g paired: AWS warns that omitting either can result in the default PHP 8.5 target rather than the requested target.
  2. Review the full diff and behavior-change summary. Do not merge a branch from an interrupted run. Pay particular attention to changes that may alter behavior without causing a syntax error. AWS’s sample includes a changed loose comparison, 0 == "abc", alongside removed or stricter constructs such as $text{0}, create_function(), each() and count(null).

AWS says the transformation runs the project’s tests and a lint pass on a patched PHP runtime. Those checks cover the paths they exercise; they do not establish identical behavior across every part of an application. Review the diff and make sure your own tests cover the behavior your application depends on. AWS also says remediation started from findings has no cost cap, another reason to keep the run in a disposable environment and monitor it.

Validate the branch before deployment

A successful transformation does not mean the deployed server is patched. In AWS’s reported tests of transformation version 2026-11-02, the generated Composer constraint for a PHP 8.4 target was ~8.4.27 || ^8.5.12; the 8.5 target used ^8.5.12. AWS reports that the PHP 8.4-target output still started on vulnerable PHP 8.5.11 under Composer’s runtime platform check, which checks the lowest allowed version.

Use the validation results to assess the transformed branch, then check the PHP version actually running in each deployment. Composer’s constraint and a successful test run do not replace installing the fixed runtime release and restarting the processes that use it.

Patch the runtime and restart its processes

  1. Update PHP where the application runs. AWS’s actions differ by deployment environment:
EnvironmentRuntime update
Amazon Linux 2023Update the installed PHP packages.
ContainersRebuild and redeploy images using a patched base image.
AWS Elastic BeanstalkUse a managed or manual platform update.
Amazon LightsailReplace instances using an updated blueprint.
Debian, Ubuntu, RHEL, or long-term-support buildsFollow the applicable vendor advisory.
AWS Lambda custom runtime or container imageRebuild and redeploy the runtime or image.
  1. Restart every relevant PHP process. After the runtime update, restart PHP-FPM, web servers that load PHP, queue consumers and long-running PHP workers. A patched package does not change the PHP version in an already-running process until that process is restarted.

A PHP version upgrade is not an architectural rewrite

The managed AWS/php-version-upgrade transformation addresses a PHP branch upgrade. Replacing PHP with another backend and frontend is a broader architectural change. In a separate first-person account, François Dexemple described a custom PHP-to-Python/Angular migration: at one validation point, 3 of 88 templates had been converted, the frontend compiled but displayed a blank screen, and some Python routes were incomplete or mocked. That individual account concerns a different task; it does not describe the managed PHP version upgrade.