← PatchMyPHP blog

PHP 8.1 is end of life: what to do about PHP2Shell

By PatchMyPHP ·

PHP 8.1 reached end of life on December 31, 2025, its last release is 8.1.34 (Dec 18, 2025), and PHP shipped no PHP2Shell fix for it on October 21, 2026. If your site runs PHP 8.1 or older, there is no patch to install: the only safe path is moving to a supported branch, and PHP 8.3 or 8.4 is the target that lasts.

This is the hardest case created by PHP2Shell (CVE-2026-109618 and CVE-2026-109619, rated 9.2 (CVSS v4.0, PHP's rating)). The flaw lets an attacker run code on the server without logging in, and for supported branches the answer is a quick update. For 8.1 and older there is no such release, so sites on those versions are both exposed and unable to patch in place.

Not sure which version you run?

Read-only: one standard page request, like a browser visit. We never send attack traffic.

Why there is no PHP2Shell fix for 8.1

PHP's project maintains only the branches still within their support window. PHP's security advisory ships the PHP2Shell fix for 8.2, 8.3, 8.4 and 8.5; 8.1 and older are out of support and receive nothing from the project. That is not an oversight. PHP 8.1's security support ended December 31, 2025, so by the time PHP2Shell was disclosed on October 20, 2026, 8.1 had already been out of maintenance for nearly a year.

There are two narrow exceptions, neither of which is a normal "update your PHP" fix:

For almost everyone, these are not practical, and the real fix is to move to a supported branch.

PHP 8.1 key dates

ReleasedNov 25, 2021
Security support endedDec 31, 2025
Last release8.1.34 (Dec 18, 2025)
PHP2Shell (CVE-2026-109618, CVE-2026-109619)No release with the fix

Where to move: supported versions

VersionLatest releaseSecurity fixes until
PHP 8.58.5.13Dec 31, 2029
PHP 8.48.4.28Dec 31, 2028
PHP 8.38.3.37Dec 31, 2027
PHP 8.28.2.36Dec 31, 2026

Skip straight to PHP 8.3 or 8.4. PHP 8.2's security support ends Dec 31, 2026, so moving there would mean another migration within weeks. PHP 8.3 runs until December 31, 2027 and 8.4 until December 31, 2028, which buys years rather than weeks. PHP 8.5 is the newest branch (8.5.13); it is a fine target if your plugins and extensions already support it.

What breaks moving from 8.1 to 8.3

From PHP's own migration guides. "Deprecated" means the code still runs but logs a notice; the rest changes behaviour and can actually break pages.

InChangeWhat it means
8.2Dynamic properties deprecatedSetting a property a class never declared now logs a deprecation notice unless the class opts in with #[\AllowDynamicProperties]. Older plugins and themes do this often.
8.2"${var}" string interpolation deprecatedThe ${ } form in double-quoted strings is deprecated; use "$var" or "{$var}".
8.2utf8_encode() and utf8_decode() deprecatedCommon in older import and export code.
8.2Case-converting functions ignore the localestrtolower(), strtoupper(), ucfirst() and similar now convert ASCII only; use the mb_ functions for other languages.
8.3Date errors throw exceptionsThe Date extension throws DateError and DateException instead of warnings, so a bad date can stop a page rather than log a warning.
8.3Negative array index behaviour changedAfter $a[-5] = x on an empty array, the next index is -4, not 0.

In practice, the deprecations rarely stop a site; the trouble comes from abandoned plugins, themes or custom code. A safe migration looks like this:

  1. Update every plugin and theme to its current version first. Replace anything unmaintained.
  2. Turn on error logging so deprecation notices and real errors are visible.
  3. Run the site on a staging copy with PHP 8.3, and walk through the pages that matter.
  4. Switch production once staging is clean, then test again and restart PHP.

The exact panel and command-line steps are in how to update your PHP version.

What to do today if you can't move yet

Until you can migrate, php.net lists php.ini mitigations that, in its own words, "reduce exposure to specific attack paths" but "do not make an installation safe". They are a stopgap, not a fix. A WAF such as Cloudflare's can block known attacks for traffic that passes through it, but only the move to a supported, patched PHP actually closes the hole.

Want to know the day it matters? Continuous monitoring reads the real PHP version from inside your server every day and emails you the day a new fix applies to your site, plus the signs of a break-in. See pricing.

Questions

When did PHP 8.1 reach end of life?

On December 31, 2025. Its last release is 8.1.34, out Dec 18, 2025.

Is PHP 8.1 affected by PHP2Shell?

Yes. Reports say every version from PHP 5.4 on is affected, and PHP shipped no 8.1 release with the fix on October 21, 2026. PHP's security team published a minimal source backport for people who build PHP themselves, and some Linux and long-term-support vendors provide backported fixes.

Should I move from 8.1 to 8.2, 8.3 or 8.4?

Move to 8.3 or 8.4. PHP 8.2's security support ends December 31, 2026, so you would be moving again within weeks. PHP 8.3 is supported until December 31, 2027 and 8.4 until December 31, 2028.

Will my site break moving off 8.1?

Most of what changes between 8.1 and 8.3 are deprecations, which log notices but keep working. The real breaks come from code relying on the behaviour changes, or from plugins and themes nobody has updated in years. Back up and test on a copy first.