Skip to content

Enabling the PHP-FPM status page on cPanel and reading it

How to expose PHP-FPM's built-in status endpoint per pool on a cPanel server, protect it from public access, and use the metrics to diagnose pool sizing in real time.

PHP-FPM ships with a status endpoint that reports active workers, queue depth, slow requests, and total processed — the data you need to size a pool properly. cPanel does not enable it by default, and even when operators enable it they sometimes leave it open to the internet. Enabling it is one config line per pool plus an Apache include that restricts access to the metrics scraper.

What’s happening

The status page is a feature of PHP-FPM itself. When pm.status_path = /status is set in a pool config, FPM serves a JSON or plain-text response from that path. Apache forwards the path to FPM the same way it forwards any other PHP request. Without an Apache-level restriction, anyone hitting https://example.com/status gets the metrics — including total request count, which is information leakage even if no secrets are exposed.

How to verify

Confirm the status path is configured and locked down:

grep -r "pm.status_path" /opt/cpanel/ea-php82/root/etc/php-fpm.d/
curl -s http://127.0.0.1/status?full
apachectl -t -D DUMP_INCLUDES | grep status

The first command shows which pools have a status endpoint. The second tests it locally (should return data). If curl from outside the host also works, the endpoint is exposed.

The fix

  1. Edit the pool config (or use MultiPHP Manager > FPM Settings > Edit > add to the pool’s INI) and add:
    pm.status_path = /fpm-status
    ping.path = /fpm-ping
    ping.response = pong
  2. Add an Apache restriction via WHM > Apache Configuration > Include Editor > Post VirtualHost Include (scoped to the domain):
    <LocationMatch "^/(fpm-status|fpm-ping)$">
        Require ip 127.0.0.1
        Require ip ::1
        Require ip 10.0.0.0/8
    </LocationMatch>
    Add the IP of your metrics scraper to the list. Do not use Require all granted.
  3. Reload FPM and Apache: systemctl reload ea-php82-php-fpm && apachectl graceful.
  4. Test from the host: curl -s http://127.0.0.1/fpm-status?full. Read the response — fields include total processes, active processes, idle processes, listen queue, listen queue len, max children reached, slow requests.
  5. The numbers that matter for sizing: max children reached should be 0 over a 24-hour window. If non-zero, increase pm.max_children. listen queue non-zero during peak means workers are saturated. slow requests non-zero means request_slowlog_timeout is firing.
  6. Plug the endpoint into your metrics stack (Prometheus’s php-fpm-exporter, Datadog’s PHP-FPM integration). Trend the active worker count over time and alert at 80% of pm.max_children.

For environments where pool sizing is observability-driven, Stack Harbor wires FPM metrics into the customer console under environment management.