# 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.

Canonical: https://red.run.cloud/learn/inventory-every-php-runtime-serving-your-business · By Timothy Lindblom · Published 2026-11-04 · Updated 2026-11-04

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.

| Fact | Detail | Source |
|---|---|---|
| Why an inventory | The UK NCSC's first step is to identify systems running PHP, internet-facing ones first | [UK NCSC](https://www.ncsc.gov.uk/news/critical-security-issue-affecting-php), 21 October 2026 |
| Fixed upstream releases | 8.5.12 · 8.4.27 · 8.3.36 · 8.2.35, or a vendor package that names both CVEs | [PHP notice](https://www.php.net/archive/2026.php#2026-10-21-5) |
| Scope | Installations serving web requests: PHP-FPM, mod_php, php-cgi, FrankenPHP, LiteSpeed | PHP notice |
| Latest PHP release | 8.5.12 and 8.4.27, both dated 22 October 2026; nothing newer listed | [PHP changelog](https://www.php.net/ChangeLog-8.php), checked 4 November |
| CISA KEV | Both CVEs added 26 October 2026, federal due date 29 October | [CISA KEV](https://raw.githubusercontent.com/cisagov/kev-data/main/known_exploited_vulnerabilities.csv), checked 4 November |
| Checked | 4 November 2026 | this page |

<div class="ln-stats"><div><b>9.2</b><span>CVSS v4 score, both CVEs</span></div><div><b>4</b><span>fixed upstream branches</span></div></div>

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

## 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](https://docs.cpanel.net/ea4/basics/about-easyapache-4/), 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](/learn/php2shell-docker-image-patched).

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.

| Where | How to list it | What it proves |
|---|---|---|
| OS packages (Debian, Ubuntu) | `apt list '?installed ?name(^php[0-9.]+$)'` (the command [Canonical](https://ubuntu.com/blog/php2shell-vulnerability-fixes-available) gives) | What is installed, not what is running |
| OS packages (RHEL family) | `rpm -qa 'php*'` | What is installed, not what is running |
| cPanel EasyApache | `rpm -qa 'ea-php*'`, and WHM, Software, MultiPHP Manager for the domain map | Installed builds, and the version assigned to each domain |
| CloudLinux alt-php | `rpm -qa 'alt-php*'` | Installed builds for the selector |
| Running services | `systemctl list-units '*php*' '*apache*' '*httpd*' '*litespeed*'` | Which services exist and when they started |
| Running processes | `ps -eo pid,lstart,args` filtered for `php-fpm`, `apache2`, `httpd` | The real binary path and start time of each worker master |
| Per-domain pools | cPanel keeps them under `/opt/cpanel/ea-phpNN/root/etc/php-fpm.d/`, per [cPanel's layout page](https://docs.cpanel.net/knowledge-base/php-fpm/php-fpm-code-and-filesystem-layout-for-easyapache-4/) | Which version's pool each domain uses |
| Containers | `docker ps` for running containers, then the image each was built from | Whether the image was rebuilt, and when |
| Platform apps | The build log or release page on your platform | The runtime the platform resolved |
| Panels | Host dashboard PHP selector | The 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](/learn/php2shell-php-fpm-restart-after-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](https://www.php.net/manual/en/function.php-sapi-name.php): `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](https://wordpress.org/documentation/article/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.

<figure class="ln-figure">
<svg viewBox="0 0 720 200" xmlns="http://www.w3.org/2000/svg" role="img" font-family="Geist, sans-serif">
<title>Five steps from finding every PHP to a dated evidence row</title>
<rect x="0" y="0" width="720" height="200" fill="#FFFFFF"/>
<g font-size="14" fill="#1A0F0F">
<rect x="10" y="60" width="124" height="80" rx="14" fill="#FFF1EF" stroke="#EAD3CF"/>
<text x="72" y="95" text-anchor="middle" font-weight="600">1. Find</text>
<text x="72" y="117" text-anchor="middle" fill="#655553" font-size="12">every PHP</text>
<rect x="150" y="60" width="124" height="80" rx="14" fill="#FFF1EF" stroke="#EAD3CF"/>
<text x="212" y="95" text-anchor="middle" font-weight="600">2. Map</text>
<text x="212" y="117" text-anchor="middle" fill="#655553" font-size="12">domains to runtimes</text>
<rect x="290" y="60" width="124" height="80" rx="14" fill="#FFF1EF" stroke="#EAD3CF"/>
<text x="352" y="95" text-anchor="middle" font-weight="600">3. Record</text>
<text x="352" y="117" text-anchor="middle" fill="#655553" font-size="12">package and SAPI</text>
<rect x="430" y="60" width="124" height="80" rx="14" fill="#FFF1EF" stroke="#EAD3CF"/>
<text x="492" y="95" text-anchor="middle" font-weight="600">4. Compare</text>
<text x="492" y="117" text-anchor="middle" fill="#655553" font-size="12">start vs install time</text>
<rect x="570" y="60" width="140" height="80" rx="14" fill="#C70500"/>
<text x="640" y="95" text-anchor="middle" font-weight="600" fill="#FFFFFF">5. Date it</text>
<text x="640" y="117" text-anchor="middle" fill="#FFFFFF" font-size="12">one evidence row</text>
</g>
<g stroke="#B00500" stroke-width="2" fill="none">
<path d="M136 100 L148 100"/><path d="M276 100 L288 100"/><path d="M416 100 L428 100"/><path d="M556 100 L568 100"/>
</g>
<text x="360" y="32" text-anchor="middle" font-size="14" fill="#655553">Repeat for every server, container and host account</text>
</svg>
<figcaption>The inventory loop. Each runtime ends as one dated row, not as a version number.</figcaption>
</figure>

## 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.

| Field | Where it comes from | Why it matters |
|---|---|---|
| Owner | You or the host | Decides who must act |
| Domains served | Panel map, pool files, web server config | Ties the runtime to the business |
| Server API | `php_sapi_name()` or the service type | Separates web PHP from command line PHP |
| Package and build | Package manager, changelog | Backports keep old version numbers |
| CVE ids in changelog | `rpm -q --changelog` or `apt changelog`, filtered for both ids | The only proof a backport contains the fix |
| Service start time | `systemctl status`, process list | Must be later than the install time |
| Install time | Package manager log | The other half of the comparison |
| Last confirmed | The date you checked | Rows go stale |

[CloudLinux's advisory](https://blog.cloudlinux.com/php-cve-2026-109618-and-cve-2026-109619) 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](/learn/php2shell-ubuntu-debian-backport-version-trap), which is why the version column alone cannot decide anything. The [Debian tracker](https://security-tracker.debian.org/tracker/CVE-2026-109618) 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](https://www.php.net/archive/2026.php#2026-10-21-5)). The [supported versions page](https://www.php.net/supported-versions.php) gives the dates that matter for planning.

| Branch | Security support ends | Fixed upstream release | Status at 4 November 2026 |
|---|---|---|---|
| 8.5 | 31 Dec 2029 | 8.5.12 | Active support |
| 8.4 | 31 Dec 2028 | 8.4.27 | Active support |
| 8.3 | 31 Dec 2027 | 8.3.36 | Security fixes only |
| 8.2 | 31 Dec 2026 | 8.2.35 | Security fixes only, ends in about two months |
| 8.1 and older | Ended | None from php.net | Needs 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](/learn/php2shell-php-8-1-and-older-eol), 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](/learn/php2shell-shared-hosting-what-to-ask-your-provider) explains the answers, and [who actually does the patching](/learn/who-is-responsible-for-patching-my-website) covers the split on each plan type. For cPanel accounts, the [cPanel guide](/learn/php2shell-cpanel-update-php) shows where the per-domain version lives, and Plesk owners can follow the [per-domain handler check](/learn/php2shell-plesk-verify-php-version). Agencies running this across clients can use the same row format in the [client triage](/learn/php2shell-agency-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

<div class="ln-selftest">
<h3>Am I affected? Where you stand right now</h3>
<p>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.</p>
<ol>
<li><span class="ln-state ln-state-detected">Detected</span> <strong>A runtime serves your site and the version it shows is below the fixed release for its branch.</strong> Treat that row as exposed. Update the package and restart the workers, or send the host question above, today.</li>
<li><span class="ln-state ln-state-unknown">Unknown</span> <strong>The version is hidden, could be a backport, or you cannot tell which runtime serves a domain.</strong> This is the common case, and the inventory exists to resolve it. Fill in the package, server API and start time for the row.</li>
<li><span class="ln-state ln-state-confirmed">Confirmed by owner evidence</span> <strong>The row holds a package changelog naming both CVEs and a service start time after the install.</strong> That runtime is covered. Whether anything got in before then is a separate question.</li>
</ol>
<p>No scan, ours included, moves you from "unknown" to "confirmed".</p>
</div>

## 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](https://raw.githubusercontent.com/cisagov/kev-data/main/known_exploited_vulnerabilities.csv) since 26 October, and [AWS reported honeypot attempts](https://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitation-prior-to-public-disclosure-in-madpot/) 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](https://advisories.ncsc.nl/2026/ncsc-2026-0443.html) and the UK NCSC both stress patching first and assessing for compromise, and the [was my site exploited](/learn/was-my-site-exploited-via-php2shell) 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)](https://www.php.net/archive/2026.php#2026-10-21-5): 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)](https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w)
3. [GHSA-6wmf-4rv5-p3rp: CVE-2026-109619 (php/php-src advisory)](https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp)
4. [UK NCSC: critical security issue affecting PHP (21 October 2026)](https://www.ncsc.gov.uk/news/critical-security-issue-affecting-php): 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)](https://advisories.ncsc.nl/2026/ncsc-2026-0443.html)
6. [PHP: php_sapi_name() manual page](https://www.php.net/manual/en/function.php-sapi-name.php): The values a runtime reports for its server API, such as cli, fpm-fcgi, apache2handler and litespeed.
7. [PHP supported versions (php.net)](https://www.php.net/supported-versions.php): Security support end dates per branch. Checked 24 October 2026.
8. [PHP 8 changelog (php.net)](https://www.php.net/ChangeLog-8.php): 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)](https://ubuntu.com/blog/php2shell-vulnerability-fixes-available): Fixed package per Ubuntu release, the apt list command, and the restart or reboot instruction.
10. [Debian security tracker: CVE-2026-109618](https://security-tracker.debian.org/tracker/CVE-2026-109618): Lists 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)](https://blog.cloudlinux.com/php-cve-2026-109618-and-cve-2026-109619): Changelog check commands and the cPanel restart scripts.
12. [cPanel: About EasyApache 4](https://docs.cpanel.net/ea4/basics/about-easyapache-4/): MultiPHP lets each domain use a different PHP version.
13. [cPanel: PHP-FPM code and filesystem layout for EasyApache 4](https://docs.cpanel.net/knowledge-base/php-fpm/php-fpm-code-and-filesystem-layout-for-easyapache-4/): Per-version config and per-domain pool files. WHM MultiPHP Manager shows each domain's version.
14. [WordPress: Site Health screen](https://wordpress.org/documentation/article/site-health-screen/): The 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)](https://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitation-prior-to-public-disclosure-in-madpot/): Vendor telemetry. Attempts from 17 October.
16. [CISA Known Exploited Vulnerabilities catalog (CSV feed)](https://raw.githubusercontent.com/cisagov/kev-data/main/known_exploited_vulnerabilities.csv): Both CVEs added 26 October 2026, federal due date 29 October. Checked 4 November 2026.
