How to check if PHP-FPM is running properly?

How to check if PHP-FPM is running properly?

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

How to check if PHP-FPM is running properly

PHP-FPM (FastCGI Process Manager) introduced in PHP 5.3.3 as part of the core distribution fundamentally changed how PHP handles requests compared to the legacy CGI/SAPI models. If you are managing a production environment, relying on assumptions about its status is risky. The common misconception that FPM runs strictly "on a port" like Nginx or Apache listens, requires a correction: FPM does not expose itself directly to the network for general request handling unless explicitly configured to do so via an listen socket or address in its pool configuration.

To verify if PHP-FPM is operational and ready to serve requests, you must distinguish between the master process state and the worker processes capable of handling traffic. The most immediate indicator of a healthy FPM instance is the availability of the FastCGI interface it exposes. Unlike standard CGI scripts which spawn one process per request, FPM maintains a pool of persistent workers. If these workers are not running, your web server will encounter timeouts or connection refused errors when attempting to execute PHP code.

You can inspect the master process status directly on most Linux distributions using system service commands. For systemd-based systems, running systemctl status php-fpm provides a snapshot of the overall health. Look for the "Active: active (running)" state. However, this only confirms the master daemon is alive; it does not guarantee that the worker processes defined in your php-fpm.conf or included pool files are actually spawned and listening.

To verify the specific listeners, you need to inspect the socket file or TCP port defined in your configuration. In modern setups, FPM defaults to a Unix domain socket located typically at /run/php/php-<version>-fpm.sock. You can check if this socket exists and has the correct permissions using:

ls -l /run/php/php-8.3-fpm.sock

If the file exists but lacks write permissions for your web server user (e.g., www-data), FPM will reject connections despite being "running." A more robust check involves using a dedicated PHP script to query the status interface. Most FPM configurations enable a built-in status page accessible at /status. While accessing this directly via HTTP is often disabled by default for security reasons, you can trigger it internally or access it via a reverse proxy if configured correctly.

Alternatively, use the php-fpm command-line tool to inspect the pool status:

sudo php-fpm -t

This validates the configuration syntax without restarting the service. To see the actual process counts, check the pool section in your config and compare it against the running processes listed by ps aux | grep php-fpm. A mismatch here indicates that the workers failed to spawn, likely due to resource constraints or configuration errors.

It is also crucial to consider how your web server communicates with FPM. If you are using Nginx, ensure the fastcgi_pass directive points to the correct socket path or IP address/port. Misconfigured paths here will result in 502 Bad Gateway errors, which might be misinterpreted as a PHP-FPM issue when the root cause is simply a broken connection string.

For Laravel applications specifically, which often run on FPM, ensure that your php.ini settings align with your application's memory and execution time requirements. Mismatches here can cause workers to crash immediately after spawning, appearing as a service outage. If you are deploying via Docker, remember that the default container entrypoint might not start FPM in the background depending on your image configuration; explicitly ensuring the php-fpm process is foregrounded or managed by the supervisor is necessary for proper lifecycle management.

Finally, monitor the logs located at /var/log/php-fpm.log. Errors regarding "unable to bind to port" or "socket already in use" are immediate red flags indicating conflicts with existing services or permission issues. Regularly auditing these logs helps prevent downtime before it impacts your application's availability.

Our network