PHP-FPM - FastCGI Process Manager

PHP-FPM (FastCGI Process Manager) is an alternative FastCGI implementation for PHP, bundled with the official PHP distribution since version 5.3.3.

When compared to the older FastCGI implementation, it contains some additional features (mostly) useful for heavy-loaded sites.

These features include:

  • advanced process management with graceful stop/start;
  • ability to start workers with different uid/gid/chroot/environment, listening on different ports and using different php.ini (replaces safe_mode);
  • stdout and stderr logging;
  • emergency restart in case of accidental opcode cache destruction;
  • accelerated upload support;
  • “slowlog” – logging scripts (not just their names, but their PHP backtraces too, using ptrace and similar things to read remote process’ execute_data) that are executed unusually slow;
  • fastcgi_finish_request() – special function to finish request and flush all data while continuing to do something time-consuming (video converting, stats processing etc.);
  • dynamic/static child spawning;
  • basic SAPI status info (similar to Apache mod_status);
  • php.ini-based config file.