1. Red
  2. Learn
  3. PHP2Shell

Check all PHP versions on a server: full inventory guide

How to check all PHP versions on a server: list every PHP runtime, map each to its domains, and record package, SAPI and restart time as PHP2Shell evidence.

By Timothy Lindblom, FounderPublished 4 November 20268 min readHow we check facts
On this page
  1. Why does one server often run several PHP versions?
  2. Where does PHP hide?
  3. How do I tell which PHP serves which domain?
  4. What should one row of the inventory contain?
  5. Which branches does the inventory need to flag?
  6. Is the inventory the same job for a host account and for my own server?
  7. The inventory checklist
  8. Am I affected? A three-state self-test
  9. What does a finished inventory not tell me?

To check all PHP versions on a server, list the installed packages, list the services and processes that serve web requests, and map every domain to one of them. Write down the package build, the server API and the service start time for each. For PHP2Shell (CVE-2026-109618 and CVE-2026-109619), that sheet is the evidence your host, client or boss will ask for.

FactDetailSource
Why an inventoryThe UK NCSC's first step is to identify systems running PHP, internet-facing ones firstUK NCSC, 21 October 2026
Fixed upstream releases8.5.12 · 8.4.27 · 8.3.36 · 8.2.35, or a vendor package that names both CVEsPHP notice
ScopeInstallations serving web requests: PHP-FPM, mod_php, php-cgi, FrankenPHP, LiteSpeedPHP notice
Latest PHP release8.5.12 and 8.4.27, both dated 22 October 2026; nothing newer listedPHP changelog, checked 4 November
CISA KEVBoth CVEs added 26 October 2026, federal due date 29 OctoberCISA KEV, checked 4 November
Checked4 November 2026this page
9.2CVSS v4 score, both CVEs
4fixed upstream branches

The score and the four fixed branches come from the PHP notice linked above. The full PHP2Shell facts are on their own page, and the patching steps per distribution are in the step-by-step patch instructions. This page covers the step before both: finding every PHP you have. More run-throughs sit with the other PHP2Shell guides.

Why does one server often run several PHP versions?

Because installing a second PHP is cheap and removing the first is rarely anyone's job. cPanel's EasyApache 4 installs several PHP versions side by side, and its MultiPHP system lets each domain use a different one. A Debian or Ubuntu server picks up a new PHP package every time someone follows a tutorial. A Docker host carries one PHP per image.

The result is that "the PHP version" is a question with several answers on one machine. The command line has one. Each domain's pool has another. A forgotten staging site has a third. The PHP notice says every installation serving web requests is in scope, so each of those answers needs a row.

Where does PHP hide?

Work down this table. Each line is a place a web-serving PHP can live, how to list it, and what the listing proves.

WhereHow to list itWhat it proves
OS packages (Debian, Ubuntu)apt list '?installed ?name(^php[0-9.]+$)' (the command Canonical gives)What is installed, not what is running
OS packages (RHEL family)rpm -qa 'php*'What is installed, not what is running
cPanel EasyApacherpm -qa 'ea-php*', and WHM, Software, MultiPHP Manager for the domain mapInstalled builds, and the version assigned to each domain
CloudLinux alt-phprpm -qa 'alt-php*'Installed builds for the selector
Running servicessystemctl list-units '*php*' '*apache*' '*httpd*' '*litespeed*'Which services exist and when they started
Running processesps -eo pid,lstart,args filtered for php-fpm, apache2, httpdThe real binary path and start time of each worker master
Per-domain poolscPanel keeps them under /opt/cpanel/ea-phpNN/root/etc/php-fpm.d/, per cPanel's layout pageWhich version's pool each domain uses
Containersdocker ps for running containers, then the image each was built fromWhether the image was rebuilt, and when
Platform appsThe build log or release page on your platformThe runtime the platform resolved
PanelsHost dashboard PHP selectorThe branch the host assigned, nothing more

The first two rows list packages. The next rows list reality. Where those disagree, the running process wins, because a PHP-FPM master keeps the code it loaded at start whatever is on disk afterwards, which is why the restart after an update matters.

How do I tell which PHP serves which domain?

Ask the runtime what it is. PHP reports its server API through php_sapi_name() and the PHP_SAPI constant, and the manual lists the values: cli for the command line, fpm-fcgi for PHP-FPM, apache2handler for Apache's module, cgi-fcgi, litespeed, and others.

That gives you a clean test. If the value is cli, you have read the command line PHP, not the one serving the site. If it is fpm-fcgi, you are looking at a PHP-FPM pool. Run the check through the web, from the site's own context, and remove the page the same minute. A page that prints PHP details publishes paths and modules to anyone who finds it.

On WordPress there is a lower-effort route. The Site Health screen has an Info tab with a Server section, and it shows the PHP the site is running under. That is the web runtime for that one site. Treat it as a pointer, and ask the host for the build.

Five steps from finding every PHP to a dated evidence row 1. Find every PHP 2. Map domains to runtimes 3. Record package and SAPI 4. Compare start vs install time 5. Date it one evidence row Repeat for every server, container and host account
The inventory loop. Each runtime ends as one dated row, not as a version number.

What should one row of the inventory contain?

A version number is not an inventory entry. Each runtime needs the fields below, because each one answers a different question someone will ask later.

FieldWhere it comes fromWhy it matters
OwnerYou or the hostDecides who must act
Domains servedPanel map, pool files, web server configTies the runtime to the business
Server APIphp_sapi_name() or the service typeSeparates web PHP from command line PHP
Package and buildPackage manager, changelogBackports keep old version numbers
CVE ids in changelogrpm -q --changelog or apt changelog, filtered for both idsThe only proof a backport contains the fix
Service start timesystemctl status, process listMust be later than the install time
Install timePackage manager logThe other half of the comparison
Last confirmedThe date you checkedRows go stale

CloudLinux's advisory shows the changelog method for its packages, using rpm -q --changelog and filtering for the two CVE ids. It says its backported packages keep lower version numbers, which is why the version column alone cannot decide anything. The Debian tracker lists fixed builds of 8.2.35-1~deb12u1 for bookworm and 8.4.27-1~deb13u1 for trixie at our 24 October check, and Canonical lists a different fixed build per Ubuntu release. These columns do not move your row to "fixed" by themselves. The start-time comparison does that part.

Which branches does the inventory need to flag?

Sort the rows by branch. The PHP project says 8.1 and older no longer receive project updates, and it published minimal source backports for 7.4, 8.0 and 8.1 (PHP notice). The supported versions page gives the dates that matter for planning.

BranchSecurity support endsFixed upstream releaseStatus at 4 November 2026
8.531 Dec 20298.5.12Active support
8.431 Dec 20288.4.27Active support
8.331 Dec 20278.3.36Security fixes only
8.231 Dec 20268.2.35Security fixes only, ends in about two months
8.1 and olderEndedNone from php.netNeeds a vendor backport or a move

Flag every row on 8.1 or older, and every 8.2 row, now. The first group needs a vendor package that names both CVEs, or a migration. The second group will need a migration within the quarter.

Is the inventory the same job for a host account and for my own server?

No, and the difference is who writes the row. On shared and managed hosting you cannot run the commands above, so your inventory records what the host tells you. Send this, and file the reply as the evidence column:

For [your domain], which PHP runtime serves web requests? Please give the server API, the fixed package, build or backport identifier for CVE-2026-109618 and CVE-2026-109619, confirm that all workers serving it were restarted or replaced, and tell me whether I need to redeploy or change a setting.

The shared hosting page explains the answers, and who actually does the patching covers the split on each plan type. For cPanel accounts, the cPanel guide shows where the per-domain version lives, and Plesk owners can follow the per-domain handler check. Agencies running this across clients can use the same row format in the client triage list.

The inventory checklist

  • List every server, hosting account, container host and platform app that serves a domain you are responsible for.
  • On each server, list installed PHP packages and the running web services separately.
  • Map every domain, including staging and old campaign sites, to one pool or runtime.
  • Record the server API for each, so command line PHP is not counted as web PHP.
  • Record the package or build, and read the changelog for both CVE ids.
  • Record the install time and the service start time, and compare them.
  • List cron, queue and scheduler PHP in a separate section, and restart long-running workers.
  • Mark every row on 8.1 or older, and every 8.2 row.
  • Add the date of the check to every row.

Am I affected? A three-state self-test

Am I affected? Where you stand right now

A check from outside can read what a site serves. It cannot see the package changelog, which runtime answers for each virtual host, or when workers last started.

  1. Detected A runtime serves your site and the version it shows is below the fixed release for its branch. Treat that row as exposed. Update the package and restart the workers, or send the host question above, today.
  2. Unknown The version is hidden, could be a backport, or you cannot tell which runtime serves a domain. This is the common case, and the inventory exists to resolve it. Fill in the package, server API and start time for the row.
  3. Confirmed by owner evidence The row holds a package changelog naming both CVEs and a service start time after the install. That runtime is covered. Whether anything got in before then is a separate question.

No scan, ours included, moves you from "unknown" to "confirmed".

What does a finished inventory not tell me?

It tells you the state of each runtime on the day you checked. It does not tell you whether anything was planted before the patch. CISA has listed both CVEs as known exploited since 26 October, and AWS reported honeypot attempts from 17 October (vendor-claimed), so a runtime that was reachable and unpatched from that date needs a look-back as well. The Dutch NCSC advisory and the UK NCSC both stress patching first and assessing for compromise, and the was my site exploited page covers what to look for.

The inventory also goes stale. A new domain, a rebuilt image or a host migration adds a row nobody checked. Keep the sheet where the next advisory will find it, and put the date of the last full pass at the top.

If you want an outside view to find domains you forgot, the free scan reads the stack each site serves and matches each version to known vulnerabilities. It is a lookup. It can say a version is affected, and it cannot confirm a backport, a restart or which pool serves a host.

Questions people ask

How do I check all PHP versions on my server?

List the installed PHP packages, then list the services and processes that actually serve web requests, then map each domain to one of them. The package list tells you what is installed. The process list tells you what is running. Only the mapping tells you which one answers for your domain.

php -v says one version but my site seems to run another. Which is right?

Both can be right. php -v reports the command line binary, and the web service can be a different build started from a different path. The server API (cli, fpm-fcgi, apache2handler, litespeed) tells you which kind of PHP is answering. Check the web runtime itself, and read the package changelog for the CVE ids.

I have PHP on my own server and on shared hosting. Do I need to check both?

Yes. Each place that serves web requests is its own runtime with its own owner. On shared hosting the host patches the runtime and you ask for written confirmation. On a server you manage, you patch and restart it yourself. Keep both on the same list so nothing is forgotten.

Do staging sites, cron jobs and queue workers count?

Staging sites that answer web requests count, especially when they are reachable from the internet. Cron and queue workers run on the command line, so the web exposure is lower, but they run the same code against the same credentials. List them, patch them, and restart any long-running worker so it loads the new binary.

How often should I redo the PHP inventory?

Redo it after any PHP advisory, any host migration, any new project or container image, and any time someone adds a domain. A sensible baseline is a dated review every quarter. The sheet is only useful if each row shows when it was last confirmed.

Can a website scan do this inventory for me?

Not completely. An outside scan can read what a site chooses to serve, such as a PHP version header, and it cannot see the package changelog, which runtime serves each virtual host, or when workers last restarted. It can help you find domains you forgot about. The rest comes from the server or the host.

Sources

  1. PHP security notice, 21 October 2026 (php.net)Fixed releases, the list of server APIs in scope, source backports for 7.4, 8.0 and 8.1. Checked 24 October 2026.
  2. GHSA-w8hw-w9fx-j79w: CVE-2026-109618 (php/php-src advisory)
  3. GHSA-6wmf-4rv5-p3rp: CVE-2026-109619 (php/php-src advisory)
  4. UK NCSC: critical security issue affecting PHP (21 October 2026)Its first step is to identify systems running PHP, internet-facing ones first. Checked 24 October 2026.
  5. Dutch NCSC advisory NCSC-2026-0443 (21 October 2026)
  6. PHP: php_sapi_name() manual pageThe values a runtime reports for its server API, such as cli, fpm-fcgi, apache2handler and litespeed.
  7. PHP supported versions (php.net)Security support end dates per branch. Checked 24 October 2026.
  8. PHP 8 changelog (php.net)8.5.12 and 8.4.27 are dated 22 October 2026. No newer release listed at our check.
  9. Canonical: PHP2Shell vulnerability fixes available (Ubuntu blog)Fixed package per Ubuntu release, the apt list command, and the restart or reboot instruction.
  10. Debian security tracker: CVE-2026-109618Lists 8.2.35-1\~deb12u1 for bookworm and 8.4.27-1\~deb13u1 for trixie. It records packages, not restarts.
  11. CloudLinux: fixed ea-php and alt-php packages (updated 23 October 2026)Changelog check commands and the cPanel restart scripts.
  12. cPanel: About EasyApache 4MultiPHP lets each domain use a different PHP version.
  13. cPanel: PHP-FPM code and filesystem layout for EasyApache 4Per-version config and per-domain pool files. WHM MultiPHP Manager shows each domain's version.
  14. WordPress: Site Health screenThe Info tab, Server section, shows the PHP the site is running under.
  15. Amazon Threat Intelligence: PHP2Shell exploitation attempts seen in MadPot honeypots (AWS Security Blog, 21 October 2026)Vendor telemetry. Attempts from 17 October.
  16. CISA Known Exploited Vulnerabilities catalog (CSV feed)Both CVEs added 26 October 2026, federal due date 29 October. Checked 4 November 2026.

Facts on this page are dated and point at the primary source next to them. If a vendor status changes after the date shown, the vendor's page wins; tell us at support@run.cloud and we will update it.