How does PHP-FPM work, and how does it interact with a web server like Nginx?
Last updated
PHP-FPM (FastCGI Process Manager) keeps a pool of persistent PHP worker processes. Nginx serves static files itself and forwards
.phprequests to FPM over FastCGI.Nginx connects via
fastcgi_pass(Unix socket or TCP port like 127.0.0.1:9000), passing params such asSCRIPT_FILENAME.Pools are sized by
pm(static, dynamic, ondemand). Reusing workers avoids per-request forking, and the split lets each side scale independently and isolates PHP crashes.