PHP upgrade

php2shell: Why Old PHP Versions Are Now a Business Risk, and How to Upgrade Your Custom PHP App Safely

Two critical PHP vulnerabilities (CVE-2026-109618 and CVE-2026-109619, nicknamed php2shell) were fixed on 21 October 2026 in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1 and older get no official fix, and 8.2 reaches end of life on 31 December 2026. If your custom PHP app is on an old version, the upgrade has moved from “when we get to it” to a business risk.

Moving to a supported version is mostly a testing job, not a rewrite. Done in stages, with a way back, it is manageable.

Fixed in8.5.12 · 8.4.27 · 8.3.36 · 8.2.35
No official fixPHP 8.1 and older
8.2 end of life31 December 2026
SeverityCVSS 4.0 score 9.2 (critical)

Updated · Reviewed by Harsimran (Harry) Singh, Director. CCNA R&S, ITIL 4, MCSA, ACS Certified Professional

What happened

A bug in PHP itself, with a hard cut-off for old versions.

As of 22 October 2026.

The PHP project's security advisory of 21 October 2026 covers two critical flaws: CVE-2026-109618 (remote code execution via out-of-memory corruption) and CVE-2026-109619 (remote code execution via stale global state, a use-after-free across requests on the same worker, which also allows memory disclosure). Both score 9.2 on CVSS v4.0, and both can allow unauthenticated remote code execution: an attacker on the internet can run code on the web server without logging in.

They affect all PHP installations serving web requests, including PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed. Because the bug sits below your application, it does not matter how carefully your own code was written. Security firms are reporting early attack attempts, and exploit code is circulating. Treat it as urgent.

PHP upgrade service

Stuck on PHP 8.1 or older?

We upgrade custom PHP apps and old WordPress sites to a supported version, test them, and hand them back working. Fixed quote before we start.

The version problem

Which versions get a fix, and which don’t.

Check the PHP supported versions page for the authoritative dates.

01

8.5, 8.4, 8.3, 8.2

Fixed in 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released on 21 October 2026. Update to those or later in the same branch.

02

8.1 and older

End of life. No official release. PHP published minimal source backports for 7.4, 8.0 and 8.1 only, which you have to build from source.

03

Vendor backports

Some distributions and long-term support vendors (for example TuxCare and CloudLinux with extended lifecycle support) ship backported builds. Ask your provider exactly what they ship.

04

8.2 end of life

PHP 8.2 reaches end of life on 31 December 2026. If you are upgrading anyway, aim for 8.3 or later.

The practical takeaway: a backport keeps an old app protected for the moment, but it leaves you dependent on a vendor and still running a language version that no longer gets its own security releases. Treat it as time bought to do the upgrade properly.

Why it isn’t a one-click change

Why your host can’t just bump the version.

Changing the PHP version takes seconds. Knowing the app still works afterwards is the real work.

01

Removed functions

Code written for PHP 7.x can rely on features that were removed. For example, create_function() and each() were removed in PHP 8.0.

02

Deprecations that become errors

Creating dynamic properties on classes was deprecated in PHP 8.2 (see the PHP manual), and passing null to non-nullable built-in function parameters was deprecated in PHP 8.1. Deprecations are warnings today and are candidates for errors later.

03

Third-party code

Frameworks, Composer packages and plugins each declare which PHP versions they support. A library that is stuck on an old version can hold the whole app back. Frameworks such as Laravel publish their supported PHP versions per release.

04

Per-version server settings

Settings such as memory_limit can be configured per PHP version, and do not carry over automatically. A 128M default has taken sites down after a version change, which is why we test on a copy first.

A safe upgrade plan

Six steps, in this order.

Nothing here needs a rewrite. It needs a copy to practise on, and a way back.

01

Inventory

List every app and plugin on PHP: the PHP version it runs, the framework and its version, the extensions it needs, Composer dependencies, and scheduled or command-line scripts. Record which PHP version the web server uses, which can differ from the command line.

02

Staging copy

Clone the code, database and server settings to a separate environment that matches production. Never try the upgrade on the live site first.

03

Tests

Automated tests give you a before-and-after comparison. If there are none, write a few smoke tests around the pages and actions that make you money, such as login, checkout, quote and booking, before you change anything.

04

Compatibility scan

Run a scanner to find the code that will break. PHPCompatibility for PHP_CodeSniffer and Rector are two open-source tools for this and for automating routine fixes. Review what they produce rather than applying it blindly.

05

Upgrade in steps

Upgrade framework and dependencies first where needed, then move one PHP branch at a time, running the tests at each step. Target a branch that is supported and has the fix, ideally 8.3 or later.

06

Rollback plan

Before go-live, take a full backup of files and database, keep the old runtime available, and write down the exact steps to switch back. After go-live, watch the error logs closely for the first few days.

Here are the three commands we reach for first. They assume a project that uses Composer, with PHPCompatibility and Rector installed as development dependencies (see the PHPCompatibility and Rector projects). Adjust the paths for your project.

# 1. Do the Composer dependencies allow the PHP version you are targeting?
composer check-platform-reqs

# 2. Scan your own code for PHP-version incompatibilities
#    (PHPCompatibility is a standard for PHP_CodeSniffer)
vendor/bin/phpcs -p --extensions=php --standard=PHPCompatibility \
  --runtime-set testVersion 8.3- src/

# 3. Preview automated upgrade changes without writing them (Rector)
vendor/bin/rector process src --dry-run

While you upgrade

Interim protection. Partial, not a fix.

PHP’s own advice: “There are no complete mitigations, updating is the only safe choice.”

  • Install a fixed build if you can. If you are on 8.2, 8.3, 8.4 or 8.5, install 8.2.35, 8.3.36, 8.4.27 or 8.5.12 or later and restart PHP-FPM, Apache or LiteSpeed. Without a restart, the old code keeps running.
  • Verify through the web, not the CLI. php -v may report a different build to the one serving requests. Check a phpinfo page served by the site (then delete it), or ask your host.
  • On 8.1 or older: ask your host or vendor for a backported build and get the answer in writing.
  • Put the site behind a WAF. Cloudflare has deployed WAF rules on all plans, but only for proxied traffic (orange cloud). DNS-only records get no protection.
  • Server settings (admins): for CVE-2026-109618, set memory_limit=-1 in php.ini or the FPM pool using php_admin_value, keep post_max_size low (8M without uploads, 32M with), and use a container or cgroup memory limit. For CVE-2026-109619, set session.upload_progress.enabled=0 in php.ini, the pool or server config (not ini_set or .user.ini), also fatal_error_backtraces=0 on PHP 8.5, and restart all workers.
  • Isolate if you can. CERT-EU suggests considering isolating internet-facing applications until they are patched.

Is this you?

Signs you have an app that needs this.

Most owners find these by asking “what runs on PHP?” rather than “what is our website?”.

  • A customer or supplier portal, quoting tool, booking system or staff intranet built by a developer who has since moved on.
  • A custom WordPress plugin or theme that nobody has touched for years.
  • A Laravel or other framework app on a release that no longer supports current PHP.
  • A hosting plan that quietly stayed on PHP 7.x, 8.0 or 8.1 because changing it once broke something.
  • A site where nobody can say which PHP version is running or who is responsible for it.

How Elite Dev can help

Tell us what you run, and we’ll tell you straight.

Elite Dev is a small Brisbane team that builds websites and automations for Australian businesses, and maintains most of what it builds. Where it fits:

01

Custom website builds

If your site should be rebuilt on a current, supported stack rather than patched forever, that is work we do. Learn more.

02

WordPress and WooCommerce

We build and maintain WordPress and WooCommerce sites, and will tell you honestly what shape an inherited one is in. Learn more.

03

Managed hosting

Updates, backups, security monitoring and uptime checks handled, with a person to call. Your account and domain stay in your name. Learn more.

04

Not sure it’s a fit?

Send us what you have: the PHP version, framework, hosting and what the app does. If a bespoke application is outside what we do, we will say so and point you at someone who does it properly.

What we will and won’t promise: we cannot promise an upgrade without seeing the code, and nobody can promise a system will never be attacked. What we can do is give you a clear inventory, an estimate based on what the compatibility scan finds, and a plan with a rollback.

PHP upgrade questions

Frequently Asked Questions

My app runs on PHP 8.1. Is there a fix?

Not an official release. PHP 8.1 and older are end of life, so there is no patched 8.1 build. The PHP project published minimal source backports for 7.4, 8.0 and 8.1 only (you build them from source), and some distributions and long-term support vendors, such as TuxCare and CloudLinux with extended lifecycle support, ship backported builds. Ask your host or vendor what they provide, and treat that as a bridge to a supported branch, not a destination.

Which PHP version should we move to?

A supported branch that already has the fix: 8.5.12, 8.4.27, 8.3.36 or 8.2.35 or later in that branch. Because PHP 8.2 reaches end of life on 31 December 2026, aim for 8.3 or later so you are not repeating this exercise in a few weeks. Check the PHP supported-versions page for current dates, and your framework’s own table of supported PHP versions.

Why can’t my host just change the PHP version for me?

Because a different PHP version can behave differently. Functions get removed, behaviour that was tolerated starts producing deprecation notices or errors, and settings such as memory_limit are often configured per version and do not carry over. A host can switch the version in seconds, but only your code, tests and staging copy can tell you whether the app still works afterwards.

Can we skip the upgrade by adding a firewall?

A WAF is a sensible stopgap, not a substitute. PHP says there are no complete mitigations and updating is the only safe choice. Cloudflare has deployed WAF rules on all plans, but they only cover traffic proxied through Cloudflare (the orange cloud), and CloudLinux notes its rules do not yet cover the OOM path.

How long does a PHP upgrade take?

It depends on the size of the codebase, how well it is tested and how many third-party libraries are involved, so we cannot give a useful number without looking at it. A small, well-maintained app is a very different job to a large legacy codebase with no tests. The inventory and compatibility scan are what turn a guess into an estimate.

Does updating WordPress or my plugins fix this?

No. The flaws are in PHP itself, not in WordPress or any plugin. The fix is a patched PHP build on the server, installed by your host or whoever manages the server, followed by a restart. WordPress and plugin updates remain important, but they do not replace it. Custom plugins can however be the reason a PHP upgrade breaks a site, so they are worth testing first.

Sources. PHP security advisory, 21 October 2026 · PHP supported versions · PHP 8.2 deprecations · CloudLinux incident · Cloudflare WAF protection · Tenable FAQ · PHPCompatibility · Rector. This article reflects what was published as of 22 October 2026. Written by Harsimran (Harry) Singh, Director. CCNA R&S, ITIL 4, MCSA, ACS Certified Professional.

PHP upgrade quote

Got a PHP app on an old version?

Tell us the PHP version, framework and hosting, and what the app does for your business. We come back with a straight answer on scope, price and timeline. Prefer the phone? Call 1300 902 000.