---
title: "php2shell Fix: Emergency PHP Upgrade Help for Old PHP"
description: "Need a php2shell fix on PHP 8.1, 7.4 or 5.x? How to triage CVE-2026-109618 and CVE-2026-109619, patch what you can, and when to upgrade or rewrite."
url: https://axiointelligence.com/blog/php2shell_emergency_php_upgrade_help
---

[← Blog](https://axiointelligence.com/blog)

php security, php upgrade, legacy php modernization, php end of life, vulnerability response

# php2shell Fix and Emergency PHP Upgrade Help for Legacy Apps on PHP 8.1, 7.x or 5.x

Brice Ayres / October 25, 2026 / Updated November 22, 2026

Short answer

If you run PHP 8.2 or newer, the php2shell fix is a runtime update to 8.2.35, 8.3.36, 8.4.27 or 8.5.12. If you run PHP 8.1 or older, the PHP project ships no fixed release. You can apply the security team's minimal source backports (7.4, 8.0 and 8.1 only), get a backport from your distribution or LTS vendor, upgrade to a supported PHP version, or, for apps several major versions behind, rewrite onto a modern stack. Isolate exposed servers while you decide, and plan around PHP 8.2's end of life on December 31, 2026.

**The short answer:** if your servers run PHP 8.2 or newer, the php2shell fix is a PHP runtime update to **8.2.35, 8.3.36, 8.4.27 or 8.5.12**, then a restart of every PHP worker. If you’re on **PHP 8.1 or older, there is no fixed PHP release**. Your options are a backport (from your distribution, an LTS vendor, or the PHP security team’s minimal source patches for 7.4, 8.0 and 8.1), an upgrade to a supported PHP version, or, when the app is several major versions behind, a rewrite onto a modern stack. While you decide, take internet-facing servers off the public internet or put them behind strict access controls. We do this work as an emergency service: patch what can be patched, upgrade what can be upgraded, and rebuild what can’t, fast enough to get you back online.

This post covers what php2shell is, how to check whether you’re affected, and what to do if the check comes back with the hard answer: an old PHP version, an app nobody wants to touch, and no clean official patch.

## What is php2shell, in one paragraph?

php2shell is the name for two critical remote code execution bugs in PHP itself, **CVE-2026-109618** (out-of-memory corruption) and **CVE-2026-109619** (stale global state, a use-after-free). The PHP project released fixes on October 21, 2026, and [the PHP Foundation](https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/) says that under the right conditions an unauthenticated attacker can run code on the server. The CVSS score is 9.2. [Google Cloud’s response post](https://cloud.google.com/blog/products/identity-security/responding-to-core-php-vulnerabilities-cve-2026-109618-cve-2026-109619) lists every version from 5.4 up as vulnerable. Per the [Canadian Centre for Cyber Security](https://www.cyber.gc.ca/en/alerts-advisories/al26-026-critical-vulnerabilities-impacting-php-cve-2026-109618-cve-2026-109619), PHP-FPM, Apache with mod\_php, php-cgi, FrankenPHP and LiteSpeed are all at risk, mod\_php most of all, and proof-of-concept code is public.

Updating WordPress, Laravel or your plugins does not fix it. The bug is in the PHP runtime, so the runtime has to change.

## Am I affected?

Check two things: your PHP version, and how PHP is served.

**Version.** All PHP versions from 5.4 through 8.5.11 are vulnerable. The fixed releases, per the [Canadian Centre for Cyber Security](https://www.cyber.gc.ca/en/alerts-advisories/al26-026-critical-vulnerabilities-impacting-php-cve-2026-109618-cve-2026-109619):

| Branch | Vulnerable | Fixed in |
| --- | --- | --- |
| 8.5 | before 8.5.12 | 8.5.12 |
| 8.4 | before 8.4.27 | 8.4.27 |
| 8.3 | before 8.3.36 | 8.3.36 |
| 8.2 | before 8.2.35 | 8.2.35 |
| 7.4, 8.0, 8.1 | all | no release; minimal source patches from the PHP security team, or a distro/LTS backport |
| 7.3 and older | all | no fix from the PHP project |

**How PHP is served.** According to the [PHP Foundation](https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/):

- **Apache with mod\_php** is the worst case. An unauthenticated request can trigger CVE-2026-109618 before any application code runs, and full remote code execution was demonstrated with default settings.
- **PHP-FPM** is not safe either. Remote code execution was confirmed through application-level code paths.

**Find every runtime, not just the main web servers.** Run `php -v` on each host and check what Apache or the FPM pool actually loads, since the CLI and the web runtime can differ. Check container base images and running containers, CI and build images, vendor appliances and admin panels that bundle PHP, and managed platforms: on Google Cloud, supported serverless runtimes are being patched automatically, but [Google](https://cloud.google.com/blog/products/identity-security/responding-to-core-php-vulnerabilities-cve-2026-109618-cve-2026-109619) says custom runtimes, Cloud Run images you build yourself, GKE workloads and Marketplace solutions still need you to update PHP and redeploy.

## How do we triage php2shell in the next hour?

Work through this in order. Each step tells you which path you’re on.

1.  **Find your version on every server.** Run `php -v` on each host and container, and check what the web server actually loads (a `phpinfo()` page on a private URL, or your FPM pool config). The CLI and the web runtime are sometimes different versions. Don’t forget staging boxes, old admin panels, vendor appliances and container images.
2.  **List what’s exposed.** Anything reachable from the internet goes to the top. Internal-only tools come second.
3.  **If you’re on 8.2, 8.3, 8.4 or 8.5:** update to 8.2.35, 8.3.36, 8.4.27 or 8.5.12 (or your distribution’s package with the fix), restart every worker, and confirm the new version is the one serving requests. You’re on the patch path.
4.  **If you’re on 8.1, 8.0 or 7.4:** there’s no official release, but [php.net](https://www.php.net/archive/2026.php) says the security team published minimal source backports for these three versions for people who build from source or don’t have an LTS vendor. Your distribution or LTS vendor may also have a backported package. Either is a stopgap, not a home.
5.  **If you’re on 7.3 or older (including any 5.x):** there’s no backport from the PHP project. You need to isolate, then upgrade or rebuild.
6.  **Isolate while you work.** Where you can’t fix right away, the Cyber Centre recommends taking internet-facing apps off public networks until a fix is applied. A VPN, an IP allowlist or a maintenance page buys time.
7.  **Look for signs you were already hit.** Review web server, application and authentication logs, and look for unexpected processes, files, accounts or outbound connections from the PHP or web server user.
8.  **Apply the session mitigation too.** On October 23, PHP published a related bug, CVE-2026-115560, that the October 21 releases don’t fix. It needs an uncommon configuration, but the recommended mitigation, `session.upload_progress.enabled=0`, is the same one already advised for CVE-2026-109619. Set it and restart workers.

## Is there a php2shell fix for PHP 8.1 or PHP 7.4?

Not a released one. The PHP project only ships fixed releases for supported branches, and [PHP 8.1 and older are past end of life](https://www.php.net/supported-versions.php). What exists:

- **Minimal source backports for 7.4, 8.0 and 8.1** from the PHP security team. Useful if you already compile PHP yourself and can test the build.
- **Distribution or LTS vendor backports.** If your OS vendor still supports your release, check their advisory first. This is often the fastest safe answer.
- **Nothing for 7.3 and older.** If you’re on PHP 5.x or early 7.x, there’s no patch to apply. The only fixes are upgrading or replacing the app.

A backport closes this hole. It doesn’t change the fact that your PHP gets no future security fixes, and php2shell won’t be the last critical PHP bug. Treat the backport as the bridge to an upgrade.

**Stuck on PHP 8.1, 7.x or 5.x and need it back online?** We do emergency php2shell patching and fast legacy PHP upgrades and rebuilds. [Book a call](https://axiointelligence.com/book) and we’ll start with your exposure and the fastest safe path.

## Should we upgrade PHP or rewrite the app?

This is the real decision for anything on 7.x or 5.x. Here’s how we make it with clients.

**Upgrade when:**

- The app is on **PHP 7.4 or 8.x**, and the jump to a supported version is one or two major versions.
- It’s built on a framework with a documented upgrade path (a recent-ish Laravel or Symfony, a maintained CMS).
- There’s a test suite, or the app is small enough to test by hand in a day.
- The dependencies (Composer packages, extensions) still exist in versions that support modern PHP.

**Rewrite when:**

- The app is on **PHP 5.x**, uses removed features (the old `mysql_*` functions, `ereg`, `each()`, magic quotes), or a framework version that’s long dead.
- Key dependencies are abandoned, so every upgrade step means replacing libraries anyway.
- Nobody on the team understands the code, and there are no tests. You’d be reverse-engineering it either way.
- The business wants changes the old codebase can’t take.

At that point an “upgrade” is really a rewrite done one painful file at a time. It’s often faster and safer to capture what the app actually does (its screens, rules, data and integrations), then rebuild it on a modern, supported stack, in PHP 8.4 or in another language if that fits your team better, and run it side by side with the old app until the outputs match. With modern tooling, we can turn that around much faster than a traditional rewrite. We’ve written about [moving systems without downtime](https://axiointelligence.com/blog/migration_without_downtime), and the same approach applies here.

## How do we upgrade PHP from 7.4 to 8 safely?

A PHP 7.4 to 8 migration breaks things in predictable places. The short version of how we run it:

1.  **Freeze and snapshot.** Back up code, database and server config, and pin the current state in version control.
2.  **Stand up the new runtime next to the old one.** A new container or server with the target PHP version (8.4 or 8.5 gives you the longest runway), not an in-place upgrade on production.
3.  **Run static analysis for compatibility.** Tools like PHPCompatibility for PHP\_CodeSniffer, PHPStan and Rector flag removed functions, changed signatures and stricter type behavior, and Rector can apply many fixes automatically.
4.  **Update dependencies.** Bring Composer packages and extensions to versions that support your target. This is often most of the work.
5.  **Test against real traffic patterns.** Exercise the main user flows, background jobs, imports and exports, and compare results with the old app.
6.  **Cut over with a rollback.** Switch traffic, watch errors and logs closely, and keep the old server ready, isolated from the internet, for a quick revert.

If you’re asking “how do I upgrade PHP” for a site on shared hosting or a managed WordPress host, the runtime switch is usually a setting in your hosting panel. The hard part is the same: make sure your themes, plugins and custom code work on the new version before you flip it.

## Does PHP 8.2 end of life matter if we just patched?

Yes. [PHP 8.2 security support ends December 31, 2026](https://www.php.net/supported-versions.php). After that, the next critical PHP bug won’t get a fixed 8.2 release, and you’ll be where 8.1 users are today. If you’re patching 8.2 for php2shell this week, schedule the move to 8.4 or 8.5 now, while it’s a planned project instead of an emergency.

## How common is end-of-life PHP?

Very. [W3Techs](https://w3techs.com/technologies/details/pl-php) reported on October 25, 2026, that among websites using PHP, 26.8% run version 7 and 7.7% run version 5. That’s roughly a third of PHP sites on versions the PHP project no longer fixes, before counting anyone on 8.0 or 8.1.

## FAQ

### What’s the php2shell patch for CVE-2026-109618?

Update the PHP runtime to 8.2.35, 8.3.36, 8.4.27 or 8.5.12, or install your distribution’s package that includes the fix, then restart every PHP worker and confirm the version serving requests. The same releases fix CVE-2026-109619.

### Is PHP 8.1 vulnerable to php2shell with no patch?

Yes, PHP 8.1 is vulnerable, and there’s no official fixed 8.1 release. The PHP security team published minimal source backports for 7.4, 8.0 and 8.1, and some distributions and LTS vendors provide backported packages. Otherwise, upgrade to a supported version.

### Is PHP 7.4 affected by php2shell?

Yes. PHP 7.4 is end of life and falls in the affected range. A minimal source backport exists, but 7.4 gets no other security fixes, so plan the PHP 7.4 to 8 migration now.

### Can a WAF stop php2shell?

Don’t count on it. The demonstrated mod\_php exploit triggers before your application code runs, and the bugs live in core memory and error handling. A WAF or network restrictions can reduce exposure while you patch, but they’re not the fix.

### How long does an emergency PHP upgrade take?

It depends on the version gap, the framework, the dependencies and whether tests exist. A supported-branch patch can be same-day. An upgrade from 7.4 or a rebuild of a 5.x app takes longer, and we’ll scope it after looking at the code rather than guess.

### Do you offer PHP upgrade services for legacy apps?

Yes. We handle php2shell emergency patching, PHP version upgrades, PHP migration services onto new servers or containers, and legacy PHP modernization, including rewriting apps that are too far behind to upgrade. See our [legacy modernization services](https://axiointelligence.com/services/legacy-modernization).

### Will rewriting our legacy PHP app take months?

Not necessarily. We start by isolating and stabilizing what’s exposed, then rebuild the parts that matter first and run old and new side by side. Modern tooling has made careful rewrites far faster than they used to be.

### Does updating WordPress, Laravel or our plugins fix php2shell?

No. The bugs are in the PHP runtime. Updating application code or plugins does not fix them. You need a patched PHP version.

### Is PHP-FPM safe from php2shell?

No. mod\_php is the easiest case to exploit, but remote code execution was also confirmed on PHP-FPM through application code paths.

### We’re on a managed platform. Are we covered?

Maybe. On Google Cloud, supported serverless runtimes are patched automatically, but you still need to redeploy custom runtimes and your own container images, and update PHP in GKE workloads and Marketplace solutions. Check your provider’s advisory.

## Where should we start?

Start with the version check on every server, and get anything exposed and unpatchable off the public internet today. If what you find is PHP 8.1, 7.x or 5.x and an app nobody wants to touch, that’s exactly the problem we solve. [Talk to us](https://axiointelligence.com/book) when you’re ready, and we’ll help you pick between patch, upgrade and rewrite.

## We do this work for a living.

A 30-minute scoping call with the engineers who would do the work.

[Book a scoping call](https://axiointelligence.com/book)

Or email [contact@axiointelligence.com](mailto:contact@axiointelligence.com?subject=Project%20inquiry) and we’ll reply.

## Related posts

Nov 25, 2026

### [We Audited 1,423 Tampa Listings. Half Had a High-Confidence Error.](https://axiointelligence.com/blog/tampa_listing_audit_high_confidence_errors)

A listing audit of 1,423 Tampa listings found a high-confidence error in 50.5%. What it checks, what it costs brokers, and how fixes reach portals.

listing audit, listing data quality, heyjameson

Nov 25, 2026

### [Converting Oracle PL/SQL Packages, Triggers and Cursors to PostgreSQL](https://axiointelligence.com/blog/migrate_oracle_plsql_packages_to_postgresql)

Migrate Oracle PL/SQL packages, triggers and cursors to PostgreSQL: package state, autonomous transactions, exceptions, and what Ora2Pg leaves.

pl/sql, plpgsql, oracle packages

Nov 25, 2026

### [Ahead of the Dec 7 Part 108 Deadline: The BVLOS Software to Build While the Rule Is Still Proposed](https://axiointelligence.com/blog/part_108_bvlos_software)

Part 108 BVLOS software to build now: detect-and-avoid, C2 and lost-link, Remote ID, and ops records, based on the FAA's still-proposed rule.

part 108, bvlos, drone software
