This page is updated as the situation changes. Last updated .
PHP 8.1 and every older version will not get an official fix. If your website runs one of them, read our guide to protecting a website on an unsupported PHP version.
PHP2Shell is the name given to two critical security flaws in PHP itself, tracked as CVE-2026-109618 and CVE-2026-109619. They allow an attacker who sends a specially crafted request to your website to run their own code on your web server, without needing a password or any account. The PHP project released fixed versions on 21 October 2026, and every website that runs PHP should be updated as soon as possible.
Because the flaws are in PHP rather than in WordPress, Joomla, Laravel or any other application, it does not matter which software your website uses. If your server runs PHP and answers web requests, it is affected until PHP has been updated. This guide explains how to find out whether your website is affected, how to patch it on the most common types of hosting, and what to do if you can't update straight away.
PHP2Shell is a pair of serious bugs in PHP, the software that runs a large share of the world's websites. By sending your website a specially made request, an attacker can take over the server it runs on and do anything there, such as stealing data, changing pages or installing malware. Almost every PHP version from the last 14 years is affected, attacks have already been seen, and the only reliable fix is to update PHP.
When PHP runs out of memory part-way through reading a request, it can be interrupted while some of its internal data is only half set up. The clean-up that follows can then treat that broken data as valid, which an attacker can use to take control of the PHP process. The PHP project rates it 9.2 out of 10 on the CVSS 4.0 scale.
Some data that belongs to one request can survive after the memory behind it has been freed. A later request handled by the same PHP worker can then use that stale data before PHP resets it, which again lets an attacker run code. It also has a CVSS 4.0 score of 9.2.
Both flaws affect every common way of running PHP on a web server, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. The PHP project says the risk is highest for Apache with mod_php, where a working exploit needs only a single request and runs before any of your website's own code is reached. PHP versions from 5.4 (released in 2012) up to 8.5.11 are affected.
Security researchers recorded attempts to exploit the flaws before they were made public, and several have since reported further attempted attacks. Government agencies including CISA in the United States and the UK's National Cyber Security Centre have told organisations to update immediately, and to take websites offline if they can't.
Your website is affected if it runs any PHP version older than the fixed version for its branch. Find your branch (the first two numbers of your version) in the table below.
| PHP branch | Affected versions | Fixed in |
|---|---|---|
| PHP 8.5 | 8.5.0 to 8.5.11 | 8.5.12 |
| PHP 8.4 | 8.4.0 to 8.4.26 | 8.4.27 |
| PHP 8.3 | 8.3.0 to 8.3.35 | 8.3.36 |
| PHP 8.2 | 8.2.0 to 8.2.34 | 8.2.35 |
| PHP 5.4 to 8.1 | Every release | No official fix |
The quickest way to find your version is to run our free PHP version checker, which now tells you whether the version it finds includes the PHP2Shell fix. Many servers hide their PHP version, so if the checker can't see it, our guide to finding your website's PHP version shows other ways to look it up.
If your server uses PHP packages from Ubuntu, Debian, Red Hat, CloudLinux or cPanel, the version number may not change when the fix is installed. These vendors often copy security fixes into their existing version (this is called backporting), so a version such as 8.1.2-1ubuntu2.20 can be safe even though it looks old. Check your vendor's security notice for CVE-2026-109618 and CVE-2026-109619 to confirm, using the links in the patching steps below.
Check my website's PHP version
If a hosting company looks after your server, it is responsible for installing the fixed PHP packages, and most large hosts have already done so. Even so, you should check rather than assume, because many hosts let each website choose its own PHP version and older versions may not have been patched.
If you manage your own VPS or dedicated server, install your operating system's updated PHP packages and then restart every PHP process. Restarting matters: the old, vulnerable code keeps running in PHP-FPM workers and Apache processes until they are restarted.
Update the package list, upgrade every installed PHP package, then restart PHP-FPM and your web server:
sudo apt update
sudo apt install --only-upgrade 'php*'
sudo systemctl restart 'php*-fpm' apache2
If you installed PHP from Ondřej Surý's repository (ppa:ondrej/php or packages.sury.org), the same commands pick up his patched builds. Check the status of your release on the Ubuntu CVE tracker or the Debian security tracker. Our Ubuntu guide and Debian guide cover moving to a newer PHP branch.
Upgrade the PHP packages with dnf, then restart PHP-FPM and your web server:
sudo dnf upgrade 'php*'
sudo systemctl restart php-fpm httpd
Red Hat lists its fixed packages on its CVE page. If you use the Remi repository, make sure it has published patched builds for your version before relying on it, as it had not on the day of the release. See our Red Hat, Fedora and CentOS guide for more detail.
Download the fixed build for your branch from php.net, replace your PHP folder with it (keeping your php.ini), and restart IIS or your web server. Our Windows guide walks through each step.
The official php images are rebuilt when PHP releases a fix. Pull the latest image for your tag, rebuild every image based on it and redeploy your containers. Running containers keep the old version until they are replaced.
docker pull php:8.4-fpm
docker compose build --pull
docker compose up -d
Once you've updated, confirm that the new version is the one actually serving your website, because a server can have several PHP versions installed. Running php -v only shows the command-line version, so also check a phpinfo() page or run our online checker again.
The PHP project is clear that updating is the only complete fix. The steps below reduce the risk while you arrange an update, but they do not make a server safe and should only be used for as short a time as possible.
session.upload_progress.enabled=0 in php.ini or your PHP-FPM pool, then restarting every PHP worker, blocks the known route for CVE-2026-109619. Setting it with ini_set() or a .user.ini file does not work, because the attack happens before those are read.post_max_size as small as your website allows (8M if you don't accept uploads) and having your web server or proxy reject oversized requests, very large numbers of form fields and deeply nested input before they reach PHP.PHP 8.1 stopped receiving security updates at the end of 2025, and PHP 8.0, 7.4 and earlier stopped years before that. The PHP project has published source code patches for 7.4, 8.0 and 8.1, but no ready-to-install versions, and nothing at all for anything older. Some Linux distributions and paid long-term support vendors have built fixed packages for older versions, so the right move depends on how your server gets PHP. Our guide to protecting a website on an unsupported PHP version explains each option and how to plan the move to a supported version.
Attacks started before the fix was released, so a website that was online and unpatched may already have been broken into. The UK's National Cyber Security Centre has urged organisations to check for backdoors, which can survive an update. After patching, it is worth spending a few minutes on these checks:
find /var/www -name '*.php' -mtime -10.site:yourdomain.com search for pages you didn't create.If you find anything suspicious, our guide to what a hacked PHP website does to your Google rankings covers cleaning up and getting search warnings removed.
Since 21 October 2026, our free checker has been used on 732 different websites. 138 of them showed which PHP version they run, and these are the results for those websites. Each website is counted once, using its most recent check.
These figures update every hour. They only cover websites that people chose to check with our tool, so they are not a random sample of the web, but they show how quickly fixes are reaching real websites. Journalists and researchers are welcome to quote them with a link to this page.
We added a PHP2Shell result to our free version checker and published this guide.
The PHP project published a related advisory about session upload progress (CVE-2026-115560). Its fix is the same session.upload_progress.enabled=0 setting, so servers that already use that workaround don't need to do anything else for this advisory.
cPanel and CloudLinux published fixed PHP packages for their platforms, including older PHP branches.
The PHP project released PHP 8.5.12, 8.4.27, 8.3.36, 8.2.35 with fixes for both flaws, along with source patches for PHP 7.4, 8.0 and 8.1. CISA and other national cyber security agencies told organisations to patch immediately. Cloudflare deployed firewall rules for all customers, and Google reminded website owners to use a 503 status code if they take their websites offline to patch. Security firm watchTowr reported attacks against its honeypot servers the same day.
The PHP project announced an urgent security release for the following day. Details of the flaws leaked online before the release.
Amazon's threat intelligence team recorded an attempt to exploit the flaws, four days before they were made public.
You can see every security fix the PHP project has published, with its severity, on our PHP security advisories page.
PHP2Shell won't be the last serious PHP security problem. Sign up for our free alerts and we will email you whenever a new PHP security release comes out, so you can patch before attackers get going.
UpdatePHP Site Manager
Create a free Site Manager account and we will email you as soon as a new version of PHP or a security fix is released. You can also add your websites, and Site Manager will show you which of them need updating.
30-day free trial Every new account starts with a 30-day free trial of all Site Manager features, and you don't need a card to sign up.