Official PHP2Shell fixes are available. Update the PHP runtime serving your applications and verify that the new code is running, not merely installed. This guide covers fixed versions, confirmed scope and steps to update PHP on Ubuntu, Debian and DNF-based systems, including PHP-FPM and Apache checks.
Updated October 21, 2026: added fixed Debian and Ubuntu package revisions and distribution-specific update steps. The official PHP advisory confirms the fixes; availability depends on each installation's repository.
Which PHP versions fix PHP2Shell?
These are the first fixed versions in maintained branches for CVE-2026-109618 and CVE-2026-109619. Their entries in the official changelog include both advisories:
| PHP branch | Fixed version |
|---|---|
| 8.2 | 8.2.35 |
| 8.3 | 8.3.36 |
| 8.4 | 8.4.27 |
| 8.5 | 8.5.12 |
For distribution packages, check the full package revision and supplier advisory: a security backport may include the fix without adopting these upstream numbers. The base version alone is not enough to classify a package as vulnerable or fixed. How security backports work.
Confirmed scope: PHP-FPM, Apache, CGI and other web deployments
PHP warns that all installations serving web requests are at risk, including PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed. It highlights mod_php, where unauthenticated remote code execution was demonstrated before application code runs. Official scope.
Both advisories are rated critical, CVSS 4.0 9.2, but describe different mechanisms:
- CVE-2026-109618: an out-of-memory failure can interrupt data initialization and lead to unsafe cleanup. Confirmed impact includes code execution with the web worker's privileges. OOM corruption advisory.
- CVE-2026-109619: request state may retain references to freed memory and be consumed by a later request in the same worker. Confirmed paths exist in mod_php and FPM, with differing requirements. Stale global state advisory.
These differences are not a reason to exclude PHP-FPM from your inventory. They also do not mean every website can be attacked identically, imply automatic root access or establish that your service has been compromised.
PHP 8.1 and older: a backport does not restore support
Official PHP 8.1 support ended on December 31, 2025. PHP 8.0 and 7.4 are also unsupported. Plan a compatible migration or verify coverage with your extended-support supplier. Unsupported PHP branches.
For this emergency, PHP links minimal source backports for 7.4, 8.0 and 8.1. These are not new releases with renewed support.
Using Remi? The official notice says rpms.remirepo.net will not have updates on October 21, 2026. Review alternatives with your administrator. PHP's repository and supplier guidance.
How to check the PHP runtime your website actually uses
1. Inventory applications individually
Include domains, subdomains, APIs, panels, accessible test environments and background processes. Record the owner, package source, effective version and update procedure. One server may contain multiple PHP installations.
These terminal queries are read-only:
php -v
php --ini
The first reports the invoked binary's version; the second identifies its configuration files. Command-line PHP may differ from your website's runtime. Also check every domain, pool and container. PHP command-line reference.
Do not leave a public phpinfo() file: it can expose paths and configuration. Use panel information or a restricted diagnostic and remove it afterward. Information exposed by phpinfo().
2. Identify the update channel
- Shared or managed hosting: ask your provider for the fixed version or package revision and confirmation that it is active on your domains.
- Self-managed VPS: assign OS and PHP updates to the administrator. Updating the hypervisor does not replace maintenance inside the VPS.
- Plesk, cPanel and other panels: check panel-managed runtimes as well as the system package.
- Docker: rebuild with a fixed base and replace running containers. Restarting the same container does not incorporate a new image. Docker image maintenance guidance.
How to update PHP on Ubuntu and Debian
Before making changes: confirm recoverable file and database backups, retain administrative access and schedule a maintenance window. Packages may restart services during installation. These examples apply to distribution-managed PHP, not panel-managed runtimes, containers or custom builds.
1. Identify your distribution and the fixed package
cat /etc/os-release
dpkg-query -W 'php*' 'libapache2-mod-php*'
The second command lists packages and revisions, not just PHP's short version. It may report an error for a pattern with no matching packages; check whether PHP comes from another channel.
| System and official package | Branch | First fixed revision for both CVEs |
|---|---|---|
| Debian 12 (bookworm) | 8.2 | 8.2.35-1~deb12u1 |
| Debian 13 (trixie) | 8.4 | 8.4.27-1~deb13u1 |
| Ubuntu 22.04 LTS | 8.1 | 8.1.2-1ubuntu2.28 |
| Ubuntu 24.04 LTS | 8.3 | 8.3.6-0ubuntu0.24.04.13 |
| Ubuntu 26.04 LTS | 8.5 | 8.5.4-0ubuntu1.5 |
| Ubuntu 26.10 | 8.5 | 8.5.9-0ubuntu2.1 |
Revisions checked on October 21, 2026 against DLA-4848-1 for Debian 12, DSA-6574-1 for Debian 13 and USN-8948-1 for Ubuntu. Later revisions from the same channel that retain these fixes also qualify. This table does not certify PPA or third-party packages.
A real backport example: Ubuntu 24.04's official 8.3.6-0ubuntu0.24.04.13 package fixes both CVEs while keeping “8.3.6”. You do not need to replace it with a manual 8.3.36 build. Likewise, Ubuntu's PHP 8.1 fix does not mean that upstream PHP has reopened support for that branch.
2. Review the update before installing
This example targets Ubuntu 24.04 with PHP-FPM 8.3. On Debian 12, replace 8.3 with 8.2; on Debian 13, use 8.4. For other Ubuntu releases, use the table's branch only if it matches your installation.
sudo apt-get update
apt-cache policy php8.3-common php8.3-cli php8.3-fpm
sudo apt-get -s install --only-upgrade \
php8.3-common php8.3-cli php8.3-fpm
Check that the candidate matches your supplier's fixed package and review the simulation. apt-get update only refreshes indexes; it does not install the patch. -s simulates the transaction. For mod_php, replace php8.3-fpm with libapache2-mod-php8.3; include both if both are installed. Also add installed CGI packages and extensions if they are not already included in the proposed update.
3. Install your runtime's packages
Once the revision and proposed transaction are correct, repeat the same package list without -s:
sudo apt-get install --only-upgrade \
php8.3-common php8.3-cli php8.3-fpm
Plan your PHP application's maintenance
Compare resources for your project and establish who updates its OS, PHP and applications. A VPS does not replace that maintenance.


--only-upgrade skips requested packages that were not installed, although dependency resolution can still occur. Do not switch distribution, branch or repository just to copy this example. If APT does not offer the fix, review security repositories, held packages and the runtime's source with your administrator. APT update and simulation reference.
How to update PHP on Fedora, RHEL, AlmaLinux and Rocky Linux
For DNF-managed installations, first identify the packages, then review the proposed upgrade without accepting it:
rpm -qa 'php*'
sudo dnf --refresh --assumeno upgrade 'php*'
Check the repository and security advisory for your distribution and branch. There is no universal RPM revision here: it depends on the channel. A “no updates available” result does not prove protection. In particular, note PHP's October 21 warning about Remi above.
Only after your supplier confirms that the proposed versions fix both CVEs, install the update:
sudo dnf --refresh upgrade 'php*'
Review which packages php* includes: it can cover parallel installations. Do not switch streams or add repositories to force a version without checking compatibility. Panel-managed runtimes or differently named packages require their own procedure. Official DNF reference.
After updating: restart PHP and check your website
For PHP-FPM on Debian or Ubuntu, validate the configuration and restart the matching service. This example uses 8.3; adjust the branch:
sudo php-fpm8.3 -t && sudo systemctl restart php8.3-fpm
systemctl is-active php8.3-fpm
dpkg-query -W php8.3-common php8.3-fpm
For an RPM installation using the standard service:
sudo php-fpm -t && sudo systemctl restart php-fpm
systemctl is-active php-fpm
rpm -q php-common php-fpm
-t checks the configuration, and && prevents the restart if that check fails. The expected service state is active; this alone does not prove that PHP is patched. Verify the package revision too. PHP-FPM options.
If Apache loads mod_php: on Debian/Ubuntu, run sudo apache2ctl configtest && sudo systemctl restart apache2 during the maintenance window. On RPM systems using that module, the usual equivalents are apachectl and the httpd service. If Apache or Nginx only forwards requests to FPM, restarting the web server alone does not replace PHP workers. Standard PHP deployments on RHEL 9 use FPM. PHP architecture on RHEL 9.
- Check each domain's runtime through the panel or a restricted diagnostic; do not expose
phpinfo(). - Restart or replace queue workers, replicas and containers still running old PHP code.
- Test login, forms and a critical application operation; review errors and 5xx responses.
- Record three pieces of evidence: an advisory covering both CVEs, the installed revision and activation in every service.
These procedures are based on official documentation, not a test performed on your VPS. If something fails, do not automatically restore a vulnerable runtime and expose it again: isolate the affected service and coordinate recovery.
Temporary mitigations: limitations and precautions
Temporary configuration changes do not replace the complete patch. These measures require administrator review and compatibility testing, not blind copying into production.
- Stale state: PHP recommends
session.upload_progress.enabled=0and restarting every worker; on PHP 8.5, alsofatal_error_backtraces=0. These reduce specific paths, not all variants. Official limitations. - Memory exhaustion: the advisory discusses
memory_limit=-1, input limits and container or cgroup isolation. Removing PHP's limit does not eliminate underlying allocation failures. Do not substituteRLIMIT_ASorRLIMIT_DATA, which can trigger the vulnerable condition. Full guidance and warnings.
The upload-progress setting must apply before request parsing, not through ini_set() or FPM .user.ini. Configuration instructions. Also assess capacity, user impact and how each change will be verified. Removing PHP's memory limit can increase consumption and availability risk: do not apply it as an isolated change.
Does Strict Mode protect against PHP2Shell?
It should not be presented as a solution for these CVEs. session.use_strict_mode rejects uninitialized session IDs and helps prevent session fixation; a custom handler without appropriate validation can make it ineffective. It is different from declare(strict_types=1), which controls typing. See session security and strict typing.
PHP2Shell frequently asked questions
Do I need to switch branches to install the patch?
Not necessarily: each maintained branch in the table has its own fix. Check compatibility and support before switching. For older installations, separate immediate remediation from the migration plan.
Is updating WordPress or Laravel enough?
No. Check the PHP interpreter running the application, even while keeping your CMS, framework and plugins current.
Does a WAF or moving hosting prove that I am protected?
Neither proves that the runtime is patched. Require the same package and activation checks in the destination environment; a provider's name is not a substitute for evidence.
Does patching remove an earlier intrusion?
Not by itself. If you observe unusual activity, preserve logs and follow your incident-response procedure. An absence of alerts does not prove that no incident occurred.
Next step: update, activate and verify
Turn your inventory into an owner-and-status checklist for each service. Prioritize exposed installations and document what remains pending with suppliers. This is operational guidance, not an audit of your servers or an exploitation test.
If you are evaluating infrastructure, explore TERAMONT VPS plans alongside maintenance responsibilities. Our guide to what a VPS is and how it works explains that distinction.







