🐘 PHP Advanced

What is PHP-FPM?

Answer

PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation designed for high-traffic sites. Instead of Apache's mod_php (which embeds PHP into every Apache process), PHP-FPM runs PHP as a separate service managing a pool of PHP worker processes. Nginx or Apache proxies PHP requests to PHP-FPM via the FastCGI protocol. Benefits: independent process management (PHP workers can be restarted without touching the web server), configurable pool sizes (per-site pools with different user permissions), graceful worker recycling (preventing memory leaks), slow request logging, and emergency restart on memory overflow. PHP-FPM with Nginx is the standard production PHP stack today, replacing the older Apache + mod_php setup.