The tricky part is that your server’s PHP version doesn’t always tell you which version actually handles live traffic. Checking the real request path and runtime logs seems like the safer way to catch these mismatches before they become security issues.
php2shell: how are you confirming which PHP your web traffic actually runs on?
3 Comments
@[Austine] I use two checks, one from each side. From the request path, put a small endpoint behind auth that returns PHP_VERSION and php_sapi_name(), then call it through the same load balancer your users hit, once per backend. That reports the runtime that actually served the request, which php -v on a shell can't do.
From the host, follow the running process instead of the PATH. readlink /proc/PID/exe on the FPM master and its workers gives the binary each one is executing, and running that path with -v gives its version. It also answers the old-workers question from the post: when a package upgrade replaces the binary, a process still running the old one shows that link with "(deleted)" on the end. Any hit after the restart means that pool never came back on the new build.
Please log in to add a comment.
Please log in to comment on this post.
More Posts
- © 2026 Coder Legion
- Feedback / Bug
- Privacy
- About Us
- Contacts
- You Tube
- Tiktok
- Premium Subscription
- Terms of Service
- Early Builders
More From Mike Dabydeen
Related Jobs
- Web DeveloperVTG · Full time · Chantilly, Fairfax County, VA
- PHP Developer (WordPress)jobgether · Part time · United States
- Web Developer(34074)idealforce · Full time · Phoenix, AZ
Commenters (This Week)
Contribute meaningful comments to climb the leaderboard and earn badges!