php-fpm(8)
PHP FastCGI Process Manager (FPM) - a high-performance process manager for PHP scripts.
Synopsis
php-fpm [options]Description
PHP-FPM is an alternative FastCGI implementation for PHP that provides a master process spawning configurable workers to handle PHP requests. It is commonly used with web servers like Nginx and Apache as a replacement for mod_php, offering better resource management and performance for high-traffic sites.
The daemon listens on a socket (Unix domain or TCP) and processes PHP scripts submitted by the web server via the FastCGI protocol. Pool configurations allow running multiple PHP instances with different settings and permissions on the same machine.
Common options
| Flag | What it does |
|---|---|
-c <path> | Specify path to php.ini configuration file |
-d <directive>=<value> | Override php.ini directive (e.g., -d display_errors=on) |
-e | Generate extended information for debugger/profiler |
-f <file> | Parse and execute file instead of reading from stdin |
-F | Run in foreground (do not daemonize) |
-g <path> | Specify PID file location |
-h | Display help message and exit |
-i | Display php.ini location |
-m | List compiled-in modules |
-t <dir> | Specify document root for chroot |
-v | Display PHP version |
--daemonize no | Disable daemonization in config override (useful for container environments) |
Examples
Start PHP-FPM in foreground mode, useful for Docker containers or debugging
php-fpm -FStart PHP-FPM with a specific php.ini configuration file
php-fpm -c /etc/php/7.4/fpm/php.iniStart PHP-FPM service using systemd (most common method on modern systems)
systemctl start php-fpmStart PHP-FPM with document root set to /var/www/html for chroot environment
php-fpm -t /var/www/htmlCheck running PHP-FPM master and worker processes
ps aux | grep php-fpmGracefully reload PHP-FPM configuration without dropping connections
systemctl reload php-fpmDisplay installed PHP version managed by PHP-FPM
php-fpm -vVerify PHP-FPM is listening on default port 9000 (common default)
netstat -an | grep 9000