How can I determine the current config of php-fpm?

How can I determine the current config of php-fpm?

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

Stefan Bogdanescu

Founder & Senior Architect

Determining Loaded PHP-FPM Configuration Without phpinfo()

When debugging production issues, you often need to verify the effective configuration of PHP-FPM without restarting services or relying on static file inspection. While phpinfo() is a staple for checking PHP settings, it explicitly omits core FPM directives like pm.max_children, pm.memory_limit, and request_terminate_timeout. These values are critical for performance tuning and troubleshooting runaway processes, yet they are hidden from standard PHP introspection tools.

To retrieve the actual runtime configuration, you must bypass the PHP script execution layer and interact directly with the FPM master process or its socket interface. The most reliable method involves using pkill combined with the FPM status page, though this requires administrative access and a running instance. A more targeted approach utilizes the php-fpm command-line tool itself, provided it is installed in the same environment as the daemon.

Inspecting via the Status Socket

PHP-FPM exposes a status page by default, configured typically in /etc/php/fpm/pool.d/ or within the main configuration file under status_path. This endpoint returns a text-based report of active processes and their current states. To extract specific configuration values from this stream, you can curl the status page and pipe it through standard Unix text processing tools like grep or awk.

The output format includes lines prefixed with max_children (which corresponds to pm.max_children) or memory_limit, though these labels vary depending on the PHP version and build. For example, a typical response might look like:

pool www: process manager dynamic, max children 5, start children 2, start servers 1, ...

By filtering for specific keys, you can quickly verify if the running daemon matches your intended configuration. However, this method has limitations: it reflects the state of the pool defined in the current master process, but it does not expose every single directive from the php.ini file unless that specific directive is mapped to a status field. If you need to know the exact value of a custom php.ini setting that isn't tracked by FPM's internal stats, this method will return nothing for that key.

Using the CLI to Query Runtime State

If your environment includes the PHP-FPM command-line binary (often installed alongside the daemon), you can leverage it to dump the configuration directly. The syntax usually involves running php-fpm -t followed by a specific pool name or directory, but behavior varies significantly between distributions and versions. On Debian-based systems, for instance, the master process might expose configuration details via the status socket without needing to restart the service, whereas other setups require reloading or restarting to refresh cached values.

A more robust strategy involves checking the php-fpm binary's built-in capabilities. Some builds support passing a --test flag that validates syntax and outputs effective settings, though this often stops at validation rather than full enumeration. In cases where direct CLI querying is unavailable, you must inspect the pool configuration files directly (e.g., /etc/php/8.x/fpm/pool.d/www.conf) and cross-reference them with the output of the status command to confirm which file is currently active.

The Limitation of Static File Inspection

A common pitfall is assuming that the contents of php-fpm.conf or pool files reflect the actual runtime environment. This assumption breaks down when dynamic reloading occurs without restarting the master process, or when multiple configuration layers (like SELinux policies or wrapper scripts) interfere with the load order. Furthermore, if a user has modified php.ini via .env files or local overrides in specific directories, those changes might not appear in static file checks unless the FPM master explicitly re-reads them during a reload cycle.

To ensure accuracy, always correlate your intended configuration files with the live status output. If you are managing a large fleet of servers, consider scripting a routine that parses the status socket output and compares it against the expected values defined in your infrastructure-as-code templates. This proactive monitoring prevents drift between your deployment scripts and the actual running state of your PHP workers.

For teams using Laravel, understanding these underlying mechanisms is crucial when optimizing queue workers or API routes that rely on specific FPM settings. While Laravel provides its own configuration abstractions, the underlying PHP-FPM constraints remain a hard boundary for performance tuning.

Our network