Tools
Log in
English

Learn to codeSecurity check

Old or vulnerable PHP version

CriticalP02PHP servers (Linux and Windows)

Check whether your PHP has a remote code execution vulnerability such as…

What is the risk

If your PHP version has a remote code execution (RCE) bug, one request with no login can take over the server. PHP2SHELL (CVE-2026-109618 and CVE-2026-109619), fixed on 21 October 2026, affects almost every PHP that serves web requests.

Safe versions today are 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0 or later. PHP 8.1 and older get no more official fixes, and security support for 8.2 ends on 31 December 2026.

Linux distributions often keep the version number and add only the fix (a backport). In that case look for the CVE number in the package changelog instead.

How to check

Debian / Ubuntu

php -v
dpkg -l | grep -E '^ii +php[0-9.]*-(fpm|cli|common) '
apt changelog php8.3-fpm | grep -m3 -E 'CVE-2026-10961[89]'

Replace php8.3 with your installed version. If the last line prints the CVE numbers, the package is fixed even if the version looks old.

RHEL / Rocky / Alma

php -v
rpm -q php-fpm php-cli
rpm -q --changelog php-fpm | grep -m3 -E 'CVE-2026-10961[89]'

Windows PowerShell (admin)

$found = @(Get-Command php.exe -All -ErrorAction SilentlyContinue | ForEach-Object Source) + @(Get-ChildItem 'C:\php*', 'C:\xampp\php', 'C:\tools\php*', 'C:\wamp64\bin\php', 'C:\laragon\bin\php', "$env:ProgramFiles\PHP" -Filter php.exe -Recurse -Depth 2 -ErrorAction SilentlyContinue | ForEach-Object FullName) | Sort-Object -Unique
if ($found) { foreach ($f in $found) { $f; & $f -v } } else { 'PHP not found / PHP 없음' }

Finds PHP on this PC and shows where it is and its version. 'PHP not found' means this PC has no PHP.

How to fix

Debian / Ubuntu

sudo apt update
sudo apt install --only-upgrade php8.3-fpm php8.3-cli php8.3-common
sudo systemctl restart php8.3-fpm
sudo systemctl restart apache2

Use your installed version. Run the last line only if you use Apache mod_php.

RHEL / Rocky / Alma

sudo dnf upgrade 'php*'
sudo systemctl restart php-fpm
sudo systemctl restart httpd

Run the last line only if you use Apache.

Windows PowerShell (admin)

$found = @(Get-Command php.exe -All -ErrorAction SilentlyContinue | ForEach-Object Source) + @(Get-ChildItem 'C:\php*', 'C:\xampp\php', 'C:\tools\php*', 'C:\wamp64\bin\php', 'C:\laragon\bin\php', "$env:ProgramFiles\PHP" -Filter php.exe -Recurse -Depth 2 -ErrorAction SilentlyContinue | ForEach-Object FullName) | Sort-Object -Unique
if ($found) { foreach ($f in $found) { $f; & $f -v } } else { 'PHP not found / PHP 없음' }
Get-Service W3SVC, *apache* -ErrorAction SilentlyContinue | Select-Object Name, Status

Step 1 · Finds PHP on this PC and shows where it is and its version (PATH, C:\php*, XAMPP, WampServer, Laragon, Program Files). If you see 'PHP not found', this PC has no PHP and there is nothing to update. NTS in the last brackets means Non Thread Safe, ZTS means Thread Safe. The last line shows the web server: W3SVC is IIS, a name starting with Apache is an Apache service. iisreset only exists where IIS is installed, so 'not recognized' is expected without IIS. Keep this window open for the next steps.

Windows PowerShell (admin)

Start-Process "https://windows.php.net/download/"

Step 2 · Opens the official PHP for Windows download page. Get the new ZIP with the same build as step 1 (x64, Thread Safe or Non Thread Safe). It usually lands in your Downloads folder.

Which ZIP? IIS needs Non Thread Safe (nts in the name). Apache (XAMPP, WampServer, Laragon, php8apache2_4.dll) needs Thread Safe. Nginx or command line only: Non Thread Safe. Not sure: match step 1 (NTS = Non Thread Safe, ZTS = Thread Safe). VS17 or VS16 is fixed per PHP version (8.4 and 8.5 use VS17). On 64-bit Windows pick x64.

Windows PowerShell (admin)

if (Get-Service W3SVC -ErrorAction SilentlyContinue) { iisreset /stop } else { Get-Service *apache* -ErrorAction SilentlyContinue | Stop-Service }

Step 3 · Stop the web server. It stops IIS if installed, otherwise the Apache service. With XAMPP press Stop for Apache in the XAMPP Control Panel instead.

Windows PowerShell (admin)

if ($found) { $php = Split-Path $found[0] } else { $php = "C:\php" }; $php
Copy-Item $php "$php.bak-$(Get-Date -Format yyyyMMdd)" -Recurse
Expand-Archive "$env:USERPROFILE\Downloads\php-8.4.x-nts-Win32-vs17-x64.zip" -DestinationPath $php -Force

Step 4 · Copy the whole PHP folder found in step 1, then unzip the new ZIP on top of it. Check the folder the first line prints and change the third line to the ZIP you downloaded. If there are several PHP installs, set $php yourself (for example $php = "C:\xampp\php"). The ZIP has no php.ini (only php.ini-production), so your php.ini stays.

Windows PowerShell (admin)

if (Get-Service W3SVC -ErrorAction SilentlyContinue) { iisreset /start } else { Get-Service *apache* -ErrorAction SilentlyContinue | Start-Service }

Step 5 · Start the web server again. With XAMPP press Start for Apache in the Control Panel.

Windows PowerShell (admin)

& "$php\php.exe" -v
& "$php\php.exe" -m

Step 6 · Check the new version and the extension list. If you see an error such as "VCRUNTIME140.dll was not found", install the Microsoft Visual C++ Redistributable (x64) from https://aka.ms/vs/17/release/vc_redist.x64.exe. If you see "not compatible with this PHP build", replace that extension (sqlsrv, xdebug and so on) with a DLL built for the new version. If something goes wrong, rename the .bak folder from step 4 back to the PHP folder name to return to the old version.

php.ini

session.upload_progress.enabled = 0
memory_limit = -1
post_max_size = 8M

PHP2SHELL stopgap. Only if you cannot update right away, put these in php.ini or the FPM pool (php_admin_value) and restart every PHP process. On PHP 8.5 also add fatal_error_backtraces = 0. If you need uploads use post_max_size = 32M and keep upload_max_filesize below it. Since the memory limit is lifted, set a container or cgroup memory limit. This blocks only some paths and does not replace updating.

Move PHP 8.1 and older to a supported branch (8.3 or later is best). If that takes time, get security patches from your distribution or a long-term support vendor first.

How to prevent it

  • Turn on automatic security updates (L04).
  • Always restart PHP-FPM or Apache after updating. Without a restart the old version keeps running from memory.
  • Rebuild and redeploy Docker images.
  • Do not forget PHP bundled inside appliances and products.

Check again after fixing

Debian / Ubuntu

php -v
systemctl status php8.3-fpm --no-pager | head -5

Check that the start time on the Active line is after the update.

Windows PowerShell (admin)

$found = @(Get-Command php.exe -All -ErrorAction SilentlyContinue | ForEach-Object Source) + @(Get-ChildItem 'C:\php*', 'C:\xampp\php', 'C:\tools\php*', 'C:\wamp64\bin\php', 'C:\laragon\bin\php', "$env:ProgramFiles\PHP" -Filter php.exe -Recurse -Depth 2 -ErrorAction SilentlyContinue | ForEach-Object FullName) | Sort-Object -Unique
if ($found) { foreach ($f in $found) { $f; & $f -v } } else { 'PHP not found / PHP 없음' }

Run the downloaded check again and make sure this item passes.

Related CVEs

CriticalCVE-2026-1096189.8HighCVE-2026-1096198.1CriticalCVE-2024-45779.8CriticalCVE-2019-110439.8CriticalCVE-2012-18239.8

Security check home