How do I check PHP-FPM service and socket health?
PHP-FPM runs PHP workers for a web server through FastCGI. The site’s configured socket or TCP upstream must match a running FPM pool, and the web-server worker must be allowed to connect. A working php command in the terminal does not confirm that this FPM path is healthy.
Before you start
- The active site configuration and its FastCGI upstream.
- Permission to inspect FPM services and logs.
Instructions
1. Discover the actual unit
List installed FPM service units. Ubuntu/Debian commonly include a PHP version in the unit name; other distributions may use php-fpm. A control panel can manage its own instances.
systemctl list-unit-files --type=service '*fpm*' --no-pagerFinds installed matching service unit files without starting or restarting them.
2. Inspect the selected instance
Replace php8.3-fpm with the exact unit serving your website. Review recent worker exits, pool capacity messages and configuration failures.
systemctl status php8.3-fpm --no-pager
sudo journalctl -u php8.3-fpm --since "15 minutes ago" --no-pager -n 60The versioned unit is an example, not an instruction to install or switch PHP versions.
3. Compare the configured socket
Check UNIX listeners for a socket upstream or TCP listeners for a TCP upstream. Read the pool’s listen permissions and compare them with the web-server worker identity.
sudo ss -lxnp
sudo ss -lntpDisplays local UNIX and TCP listeners so the actual configured FastCGI endpoint can be located.
Check the result
- The correct FPM pool is running, the expected endpoint exists and a normal PHP page executes through the web server.
Troubleshooting
- The socket exists but the proxy reports permission denied
- Inspect the pool’s listen ownership/mode and any applicable security policy. Do not make the socket world-writable or switch to a public TCP bind.
Official references
Use the documentation for your installed version when a flag, service name or platform feature differs.
