The PHP2Shell fixes released on 21 October 2026 (8.2.35, 8.3.36, 8.4.27 and 8.5.12) only cover supported branches. If a server runs PHP 8.1, 8.0, 7.4 or older, no new php.net release is coming. Those versions are still vulnerable. The background is in our PHP2Shell explainer. This post covers what to do when your PHP is past end of life.
Where each old branch stands
| Branch | Upstream status | PHP2Shell fix from PHP |
|---|---|---|
| 8.1 | End of life 31 Dec 2025 | Minimal source backport only |
| 8.0 | End of life Nov 2023 | Minimal source backport only |
| 7.4 | End of life Nov 2022 | Minimal source backport only |
| 7.3 and older, PHP 5 | Long end of life | None; affected (Sansec traces the bugs back to PHP 5.4) |
| 8.2 | Supported until 31 Dec 2026 | Fixed in 8.2.35, but plan to move on |
You have four realistic options, often used together: a patched package from your OS or a long-term-support vendor, a source build with PHP's backport, an upgrade, and isolation while you get there.
Option 1: a patched vendor package
This is the fastest fix if your platform has one, because it keeps your PHP version and only swaps in patched code. What we could confirm from vendor sources:
| Platform | Old PHP | Status |
|---|---|---|
| Ubuntu 22.04 LTS | 8.1 | Fixed, free: 8.1.2-1ubuntu2.28 (USN-8948-1) |
| Ubuntu 20.04 / 18.04 / 16.04 / 14.04 | 7.4 / 7.2 / 7.0 / 5.5 | Fixed in Ubuntu Pro (ESM) packages |
Ondřej Surý repo (ppa:ondrej/php, packages.sury.org) | 5.6 to 8.1 | Patched builds dated 21–22 Oct; changelog names both CVEs |
| Amazon Linux 2023 | php8.1 | No Fix Planned; move to php8.2 or later |
| Amazon Linux 2 | core php | No Fix Planned; the php8.2 extra is fixed |
| RHEL, AlmaLinux, Rocky | Module streams | Check your stream's errata for the CVEs; Red Hat is releasing fixes in stages |
Commercial extended-support vendors such as TuxCare ELS and ZendPHP LTS also ship patched builds of old branches, and Freexian ELTS covers older Debian releases. Check the vendor's own advisory for the two CVE IDs before you rely on any of them.
Whichever source you use, verify the installed package rather than the version string. A patched 8.1 build still reports 8.1.x.
# Debian/Ubuntu: search the whole changelog (Sury's CVE line may not be in the top entry)
zgrep -E 'CVE-2026-10961(8|9)' /usr/share/doc/php8.1-common/changelog.Debian.gz
# RHEL family
rpm -q --changelog php-common | grep -E 'CVE-2026-10961(8|9)'Option 2: build from source with PHP's backport
The PHP security team published minimal source backports for 7.4, 8.0 and 8.1 for people who build PHP themselves. There is no tarball, binary or version bump. This suits teams that already compile their own PHP, such as custom Docker base images. You own the build from then on, including every future security fix, and the official Docker Hub 8.1 and older tags have not been rebuilt, so images based on them need your own build or a vendor image.
Option 3: upgrade to a supported branch
A backport fixes this bug. It does not fix the next one. 8.2 itself reaches end of life on 31 December 2026, so for an upgrade made now, aim for 8.4 (security support to 31 Dec 2028) or 8.5 (to 31 Dec 2029). If you need a stopgap, 8.3 is supported until 31 Dec 2027.
A sensible order of work:
- Patch first using Option 1 or 2 (or isolate using Option 4). An upgrade project should not leave you exposed in the meantime.
- Inventory the app: framework and CMS versions, Composer dependencies, PHP extensions (
php -m) and anything compiled or proprietary such as ionCube-encoded modules. Check each supports the target version. - Run static checks: PHPCompatibility for PHP_CodeSniffer to flag removed functions and syntax, and Rector to apply many of the mechanical changes automatically.
- Update dependencies with
composer updateagainst the target platform. Old framework versions are often what blocks an upgrade, so upgrading the framework may be the real project. - Test on a staging copy with production-like data. Common breaks from 7.4: stricter comparisons between strings and numbers, warnings that became errors, removed functions such as
each()andcreate_function(), and dynamic property deprecations from 8.2. - Switch over with a rollback ready. Running two PHP-FPM versions side by side (one pool per version) lets you move one site at a time.
For WordPress, Drupal, Magento and similar platforms, check the platform's own PHP compatibility matrix first; the core may be fine while an old plugin or theme is not.
Option 4: isolate what you cannot fix yet
Some systems, often PHP 5 or 7.3 applications that nobody can easily change, have no fix at all. For those, reduce who can reach them and what they can do:
- Take it off the public internet. Put it behind a VPN, an identity-aware proxy or at least an IP allowlist. PHP2Shell needs no login, so application passwords do not help, but network-level access control does.
- Apply the temporary settings from the explainer:
session.upload_progress.enabled = 0, a smallpost_max_size, andmemory_limit = -1only with a hard memory cap outside PHP. These lower the risk without removing it. - If the app never takes file uploads, block
multipart/form-dataat the proxy or WAF. - Contain the damage: a dedicated host or container, a read-only filesystem where possible, no outbound internet access except what the app needs, and least-privilege database and cloud credentials.
- Watch it: alert on the web user spawning shells and on new files in the web root.
- Set a decommission or migration date and give it an owner. Isolation is a holding pattern, not a fix.
Choosing quickly
| Situation | Do this now | Then |
|---|---|---|
| Ubuntu 22.04 with stock php8.1 | apt upgrade, restart | Plan to move to 8.4 or 8.5 |
| Sury PPA with 7.4 / 8.0 / 8.1 | Update, check changelog, restart | Upgrade the app |
| Amazon Linux 2023 php8.1 | Isolate; move to php8.2+ stream | Target 8.4 or 8.5 |
Docker image on official php:8.1 | Isolate; build your own patched base or use a vendor image | Upgrade the image and app |
| PHP 5.x or 7.0–7.3 on an old OS | Isolate now | Vendor backport if available, else migrate or retire |
If you have to justify the work, use this incident. Cyber Essentials, for example, expects critical and high-risk patches within 14 days and unsupported software to be removed or isolated (see our Cyber Essentials guide).
Sources
- PHP security advisory, 21 October 2026 and supported versions
- watchTowr PHP2Shell FAQ
- Sansec research
- Ubuntu CVE-2026-109618 and Amazon Linux
- Ondřej Surý package repository
HashTech Systems handles PHP2Shell remediation for end-of-life PHP, including vendor backports, source builds, isolation and upgrade planning.

