×
UpdatePHP Pro Log in Register
PHP expiry alert : PHP v8.1 has recently expired. Is your website still running this version? Click here for more details
SAFE versions of PHP: 8.5.12, 8.4.27, 8.3.36, 8.2.35
☰

How to protect a website on an unsupported PHP version

PHP2Shell (CVE-2026-109618 / CVE-2026-109619) is a critical security problem in PHP itself that lets attackers take over web servers. Every website that runs PHP should be updated to 8.5.12, 8.4.27, 8.3.36, 8.2.35 or newer as soon as possible. Read our PHP2Shell check and patch guide.

Every PHP version receives security fixes for a set number of years and then stops. As of October 2026, PHP 8.1 and every older version have reached the end of their life, which means the PHP project no longer fixes security problems in them. A large share of the web still runs these versions, and when a serious flaw such as PHP2Shell is found, those websites are left exposed.

An unsupported version doesn't mean your website has to stay unprotected, though. Depending on how your server gets PHP, there may be a patched build you can install today while you plan a proper upgrade. This guide walks through the options, starting with the best long-term one.

PHP 8.2 reaches the end of its life on 31 December 2026. If you are upgrading from an older version now, go straight to PHP 8.4 or 8.5 so you don't have to do it all again in a few months. You can check every branch's dates on our PHP support timeline.

Option 1: upgrade to a supported PHP version

Moving to a supported version is the only option that keeps your website protected against future problems as well as current ones. It also tends to make websites noticeably faster. The risk is that code written for an old version of PHP may not work on a new one, so it pays to approach it in steps.

  1. Make a full backup of your files and database, following our guide to backing up a website before upgrading PHP.
  2. Update your CMS, plugins and themes first. Recent releases of WordPress, Joomla, Drupal and most popular plugins already support PHP 8.4, and updating them first removes most upgrade problems.
  3. Test on a copy of your website running the new version, as explained in our guide to testing your website on a newer version of PHP.
  4. Fix anything that breaks. Our list of common PHP errors after upgrading covers the problems people run into most often.
  5. Switch the live website over, either in your hosting control panel or by upgrading PHP on your own server.

If the upgrade turns out to be more work than you can take on, a PHP developer can usually do it far faster than you would expect, and our step-by-step migration plan shows what's involved.

Option 2: use your Linux distribution's packages

If your server got PHP from its operating system, for example Ubuntu 22.04 (which ships PHP 8.1) or Red Hat Enterprise Linux 8 or 9, your distribution may still be fixing security problems in that version even though the PHP project has stopped. These fixes are copied into the existing version, so the version number stays the same while the problem goes away.

Installing your distribution's latest packages (sudo apt update && sudo apt upgrade on Ubuntu and Debian, or sudo dnf upgrade on Red Hat and its relatives) is enough in this case. Check your distribution's security tracker for the specific flaw to make sure your release is covered, because older releases that have reached their own end of life also stop getting fixes.

Option 3: pay for extended support

Several companies sell patched builds of PHP versions that the PHP project no longer supports. This won't fix compatibility problems in your website, but it buys time to upgrade properly while your server stays protected.

If you're on shared hosting, ask your host whether the old PHP versions in your control panel are patched builds like these. Many are, and many aren't.

Option 4: build PHP from the security patches

For PHP2Shell, the PHP security team published minimal source code patches for PHP 7.4, 8.0 and 8.1 on GitHub, aimed at people who build PHP themselves. If you are comfortable compiling PHP, you can build a fixed version from the PHP-7.4-CVE-2026-109618-109619, PHP-8.0-CVE-2026-109618-109619 or PHP-8.1-CVE-2026-109618-109619 branch of the php-src repository. This only covers PHP2Shell, not any of the other problems found since your version stopped being supported, so treat it as a stopgap.

While you sort it out

Until your website is on a patched or supported version, you can reduce the risk with a web application firewall such as Cloudflare's, which blocks known attacks on all of its plans. Turn off any PHP features your website doesn't use, and keep PHP's own settings as strict as you can, as described in the temporary measures section of our PHP2Shell guide. If the risk is too high to keep the website online, take it down properly with a 503, as explained in our guide to pausing a PHP website while you patch it.

Finally, sign up for our PHP version alerts. We will remind you before your next PHP version reaches its end of life, so you have time to plan the upgrade instead of rushing it.

Back to PHP Security Alerts
Article last updated: 24th October, 2026