Ask a large organization which PHP versions it runs and you will get a confident answer. Check, and you will almost always find more. A version on a forgotten reporting server. A container image built two years ago and never rebuilt. A vendor appliance with PHP inside it. A CI runner still testing against 7.2.
Every modernization plan, every compliance answer and every security response starts from the inventory. So build one properly.
What to record
For each place PHP runs:
- Where: host, container image, cluster or appliance
- What: the PHP version, down to the patch release
- Source: distribution package, vendor build, official image or compiled by hand
- Extensions: the loaded list, especially anything compiled separately
- Owner: the team or person accountable for it
- Application: what it serves, and how important that is
- Support status: community supported, vendor supported or unsupported, with the end date
Where to look
- Configuration management and infrastructure code. Ansible, Terraform, Puppet and similar tools state what should be installed. Start here, but do not stop here.
- The hosts themselves.
php -vandphp -mon every server, collected by whatever remote execution you already use. - Container registries. Every image tag still in use, inspected for its PHP version, not just the images you think are current.
- CI pipelines. The versions you test against shape the versions you can ship.
- Web server and FPM configuration. Hosts sometimes run several PHP versions side by side, with different sites pointed at each.
- Dependency manifests.
composer.jsonandcomposer.lockshow what each application expects, which is useful for planning upgrades. - Vendors and appliances. Ask suppliers what PHP their products embed, and what their support plans are.
Keeping it true
An inventory is only useful while it is accurate. Automate the collection, run it on a schedule, and alert when something new appears or something reaches a support end date. Treat a mismatch between what you expect and what you find as a finding in its own right.
What to do with it
Sort by support status and importance. The top of the list is everything unsupported that serves something important. For each item, decide: upgrade, migrate, cover with long-term support while you plan, or retire. Write the decision and the date next to it.
That table answers most of the questions a security team, an auditor or a customer questionnaire will ask. It is also the plan.