What is PHP-FPM
From PHP-FPM
Unfortunately, PHP in the form in which it is available from php.net has a number of well-known issues associated with the use of the FastCGI SAPI in production.
The following is a comparison chart of problems and how php-fpm handles them, when enabled with the FastCGI SAPI:
| Description | php "out of the box" | spawn-fcgi + spawn-php.sh + daemontools | php-fpm |
|---|---|---|---|
| php daemonization: pid file, log file, setsid(), setuid(), setgid(), chroot() | (-) | (+) | (+) |
| Process Management. Ability to "graceful" stop and start php workers without losing any queries. The possibility of gradually update the configuration and binary without losing any queries. | php4 (-), php5 (only graceful completion) | (-) | (+) |
| Restricting ip addresses from which requests can come from a web server | php4 (-), php5 (+) (from 5.2.2) | (-) | (+) |
| Dynamic number of processes, depending on the load | (-) | (-) | TODO |
| Starting the workers with different uid/gid/chroot/environment and different php.ini option. You do not need a safe mode! | (-) | (-) | (+) |
| Logging stdout & stderr business processes | (-) | (-) | (+) |
| Emergency restart all the processes in the event of accidental destruction of shared memory opcode cache, if used accelerator | (-) | (-) | (+) |
| Forcing the completion of process if set_time_limit() fails | (-) | (-) | (+) |
| Features | |||
| Error header | (+) | ||
| Accelerated upload support | (+) | ||
| fastcgi_finish_request() | (+) | ||
| Slowlog | (+) | ||
