How does PHP-FPM work, and how does it interact with a web server like Nginx?

Last updated 15 June 2026

  • PHP-FPM (FastCGI Process Manager) keeps a pool of persistent PHP worker processes. Nginx serves static files itself and forwards .php requests to FPM over FastCGI.

  • Nginx connects via fastcgi_pass (Unix socket or TCP port like 127.0.0.1:9000), passing params such as SCRIPT_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.

  • https://www.digitalocean.com/community/tutorials/understanding-and-implementing-fastcgi-proxying-in-nginx
  • https://www.freecodecamp.org/news/the-nginx-handbook/
All PHP interview questions