10-22-2026, 03:43 PM
How to Fix PHP2Shell (CVE-2026-109618/109619) on cPanel & WHM
On 21 October 2026 PHP released emergency fixes for two critical bugs, CVE-2026-109618 and CVE-2026-109619 ("PHP2Shell"). They can let an attacker run code on your server without logging in, and attacks are already happening. This guide shows how to patch a server running cPanel & WHM, step by step.
New to PHP2Shell? Read the overview first: PHP2Shell explained: what it is and how to fix it.
The fixed versions
Your PHP must be at least: 8.5.12, 8.4.27, 8.3.36 or 8.2.35. Older branches (7.4 to 8.1) need a patched build from your vendor. Update every PHP version installed, not just the one your main site uses.
Step 1: See which PHP versions you have
cPanel's PHP versions come from EasyApache 4 and are named, and so on. In WHM, open Software > MultiPHP Manager to see them. From the terminal:
Step 2: Update the ea-php packages
If automatic updates are on, cPanel installs new EasyApache packages in its nightly update. To update now, as root:
(Use instead of on older CentOS 7 servers.) The fixed builds are 8.2.35, 8.3.36, 8.4.27 and 8.5.12. If dnf finds nothing yet, cPanel may not have published them; check again later and apply the temporary protection below.
If your server runs CloudLinux with alt-php, also update those:. If you use LiteSpeed, update the same way.
Step 3: Restart Apache and PHP-FPM
On LiteSpeed:
Step 4: Confirm
Run the version loop from Step 1 again. Every ea-php version should show a fixed version.
Check the version your websites really use
The command line can show a different PHP from the one serving websites. To be sure, create a file called in a website's folder containing:
Open , check the number, then delete the file.
Can't update yet? Temporary protection
These settings reduce the risk until a patched version is installed. They are not a full fix. Add them to the php.ini of each PHP version (WHM > Software > MultiPHP INI Editor > Editor Mode for each PHP version), then restart PHP:
Don't set these with or a file; they must be set server-side. The PHP team also suggests against CVE-2026-109618, but that removes PHP's memory cap, so only use it short-term and with care.
After patching: check you weren't hit
Attacks started on 17 October, before the fix existed. Spend ten minutes on these checks:
Questions? Ask in cPanel Security Support with your OS, cPanel & WHM version and the output of your PHP version check.
Sources (checked 22 October 2026): Tenable PHP2Shell FAQ · Qualys: mitigate and patch PHP2Shell
On 21 October 2026 PHP released emergency fixes for two critical bugs, CVE-2026-109618 and CVE-2026-109619 ("PHP2Shell"). They can let an attacker run code on your server without logging in, and attacks are already happening. This guide shows how to patch a server running cPanel & WHM, step by step.
New to PHP2Shell? Read the overview first: PHP2Shell explained: what it is and how to fix it.
The fixed versions
Your PHP must be at least: 8.5.12, 8.4.27, 8.3.36 or 8.2.35. Older branches (7.4 to 8.1) need a patched build from your vendor. Update every PHP version installed, not just the one your main site uses.
Step 1: See which PHP versions you have
cPanel's PHP versions come from EasyApache 4 and are named
Code:
ea-php82Code:
ea-php83Code:
for p in /opt/cpanel/ea-php*/root/usr/bin/php; do echo "$p $($p -r 'echo PHP_VERSION;')"; doneStep 2: Update the ea-php packages
If automatic updates are on, cPanel installs new EasyApache packages in its nightly update. To update now, as root:
Code:
dnf clean all
dnf update 'ea-php*' 'ea-apache24*'Code:
yumCode:
dnfIf your server runs CloudLinux with alt-php, also update those:
Code:
dnf update 'alt-php*'Code:
lsphp*Step 3: Restart Apache and PHP-FPM
Code:
/scripts/restartsrv_httpd
/scripts/restartsrv_apache_php_fpmCode:
/usr/local/lsws/bin/lswsctrl restartStep 4: Confirm
Run the version loop from Step 1 again. Every ea-php version should show a fixed version.
Check the version your websites really use
The command line can show a different PHP from the one serving websites. To be sure, create a file called
Code:
v.phpCode:
<?php echo PHP_VERSION;Code:
https://your-domain/v.phpCan't update yet? Temporary protection
These settings reduce the risk until a patched version is installed. They are not a full fix. Add them to the php.ini of each PHP version (WHM > Software > MultiPHP INI Editor > Editor Mode for each PHP version), then restart PHP:
Code:
session.upload_progress.enabled = 0
; PHP 8.5 only:
fatal_error_backtraces = 0Code:
ini_set()Code:
.user.iniCode:
memory_limit = -1After patching: check you weren't hit
Attacks started on 17 October, before the fix existed. Spend ten minutes on these checks:
- PHP files created or changed since 17 October that you don't recognise, especially in upload folders:
Code:find /home/*/public_html -name "*.php" -newermt 2026-10-17 -type f 2>/dev/null | head -50 - Unknown cron jobs: for root and each site user.Code:
crontab -l
- Unusual CPU use (crypto miners are common): Code:
ps aux --sort=-%cpu | head
Questions? Ask in cPanel Security Support with your OS, cPanel & WHM version and the output of your PHP version check.
Sources (checked 22 October 2026): Tenable PHP2Shell FAQ · Qualys: mitigate and patch PHP2Shell

