Glossary

PHP-FPM

The service that runs PHP code for web servers like Nginx, using a pool of worker processes.

In plain English The part of the server that runs PHP code, the language WordPress and many sites are written in, and hands the finished page to the web server.

PHP-FPM (FastCGI Process Manager) is the service that runs PHP code for web serversWeb server The program that answers visitors’ browsers and sends them your website. Also used for the computer it runs on. More about Web server →. The web server, usually Nginx, receives a request for a PHP page and passes it to PHP-FPM, which runs the code and sends back the finished HTML. WordPress, Drupal, Laravel and most PHP software run this way.

Pools and workers

PHP-FPM keeps a pool of worker processes ready. Each worker handles one request at a time. Pool settings decide how many:

pm = dynamic
pm.max_children = 12
pm.start_servers = 3
pm.min_spare_servers = 2
pm.max_spare_servers = 5

pm.max_children is the important one: the most requests PHP can handle at once. Too low and visitors queue at busy times; too high and the server runs out of memory. Each site on a server can have its own pool, running as its own user, which keeps sites separated.

Where things are

Debian and UbuntuAlmaLinux, Rocky, RHEL
Servicephp8.3-fpm (version in the name)php-fpm
Pool files/etc/php/8.3/fpm/pool.d//etc/php-fpm.d/
Socket/run/php/php8.3-fpm.sock/run/php-fpm/www.sock

When it goes wrong

If PHP-FPM stops, or NginxNginx A fast, popular program that sends web pages to visitors and can pass requests on to apps behind it. More about Nginx → points at the wrong socket, visitors see 502 Bad Gateway. When every worker is busy, the log says server reached pm.max_children and visitors see slow pages or 503. Slow PHP leads to 504 Gateway Timeout.

Questions people ask

What does PHP-FPM stand for?

PHP FastCGI Process Manager. FastCGI is the way the web server and PHP talk to each other; the process manager keeps the pool of PHP workers running.

How do I restart PHP-FPM?

On Ubuntu and Debian: sudo systemctl restart php8.3-fpm (use your PHP version). On AlmaLinux and Rocky: sudo systemctl restart php-fpm. On cPanelcPanel The most popular hosting control panel: a website where you manage your email, files, databases and domains with point-and-click tools instead of commands. More about cPanel → servers, use PHP-FPM service for ApacheApache One of the most common programs that sends web pages to visitors. It is the waiter between your website’s files and the people asking for them. More about Apache → in WHMWHM WebHost Manager: the administrator side of cPanel, used by whoever runs the server to create and manage hosting accounts. More about WHM →’s Restart Services.

Is PHP-FPM faster than mod_php?

Usually yes for busy sites, because it keeps workers ready and lets the web server serve images and files without loading PHP. It also lets each site run as its own user. See managing PHP in WHM.

Official documentation: www.php.net