PHP-FPM (FastCGI Process Manager: FastCGI Process Manager) is a PHPFastCGI manager. For php before PHP 5.3.3, it is a patch package, aiming to integrate FastCGI process management into the PHP package.
If you are using PHP before PHP5.3.3, you must patch it into your PHP source code and then use it after compiling and installing PHP.
Compared with Spawn-FCGI, PHP-FPM has better control in terms of CPU and memory, and the former is easy to crash and must be monitored with crontab, while PHP-FPM does not have this kind of trouble.
Since PHP 5.4 RC2, php-fpm has become a regular and is no longer marked as EXPERIMENTAL by the php team.
PHP5.3.3 has integrated php-fpm and is no longer a third-party package. PHP-FPM provides a better PHP process management method, which can effectively control memory and processes, and can smoothly reload PHP configuration. It has more advantages than spawn-fcgi, so it was officially included by PHP. When ./configure, you can enable PHP-FPM with the –enable-fpm parameter.
Use PHP-FPM to control the FastCGI process of PHP-CGI
/usr/local/php/sbin/php-fpm{start|stop|quit|restart|reload|logrotate}
- --start Start php's fastcgi process
- --stop Force terminates the fastcgi process of php
- --quit Smoothly terminate the fastcgi process of php
- --restart Restart the fastcgi process of php
- --reload Resmoothly load php
- --logrotate Re-enable log file
Can php-fpm be used with optimizers such as ZendPlatform, xcache, eAccelerator, APC, etc.?
Yes. The php-fpm architecture and any shared memory for high-speed opcode cache are applicable. The only limitation is: All worker processes can only apply to one cache, even if they run with different uid/gid
The above is the detailed content of what phpfpm is used for. For more information, please pay attention to my other related articles!