$linuxjunkies
>

php-fpm(8)

PHP FastCGI Process Manager (FPM) - a high-performance process manager for PHP scripts.

UbuntuDebianFedoraArch

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

FlagWhat it does
-c <path>Specify path to php.ini configuration file
-d <directive>=<value>Override php.ini directive (e.g., -d display_errors=on)
-eGenerate extended information for debugger/profiler
-f <file>Parse and execute file instead of reading from stdin
-FRun in foreground (do not daemonize)
-g <path>Specify PID file location
-hDisplay help message and exit
-iDisplay php.ini location
-mList compiled-in modules
-t <dir>Specify document root for chroot
-vDisplay PHP version
--daemonize noDisable daemonization in config override (useful for container environments)

Examples

Start PHP-FPM in foreground mode, useful for Docker containers or debugging

php-fpm -F

Start PHP-FPM with a specific php.ini configuration file

php-fpm -c /etc/php/7.4/fpm/php.ini

Start PHP-FPM service using systemd (most common method on modern systems)

systemctl start php-fpm

Start PHP-FPM with document root set to /var/www/html for chroot environment

php-fpm -t /var/www/html

Check running PHP-FPM master and worker processes

ps aux | grep php-fpm

Gracefully reload PHP-FPM configuration without dropping connections

systemctl reload php-fpm

Display installed PHP version managed by PHP-FPM

php-fpm -v

Verify PHP-FPM is listening on default port 9000 (common default)

netstat -an | grep 9000

Related commands