Home > Backend Development > PHP Tutorial > Detailed explanation of php-fpm process shutdown and restart script_PHP tutorial

Detailed explanation of php-fpm process shutdown and restart script_PHP tutorial

WBOY
Release: 2016-07-13 10:47:02
Original
970 people have browsed it

Today I will introduce to you the php-fpm process shutdown and restart commands. PHP-FPM is a PHP FastCGI manager. It is only used for PHP and PHP5.3.3 has integrated php-fpm. No. It’s a third-party package again.

First, let’s understand what php-fpm is

PHP-FPM is a PHP FastCGI manager, only for PHP. ​

PHP-FPM is actually a patch of the PHP source code, designed to integrate FastCGI process management into the PHP package. It must be patched into your PHP source code, and it can be used after compiling and installing PHP. Now we can download the branch that directly integrates PHP-FPM in the source tree of the latest PHP 5.3.2. It is said that the next version will be integrated into the main branch of PHP. Compared with Spawn-FCGI, PHP-FPM has better CPU and memory control, and the former crashes easily and must be monitored with crontab, while PHP-FPM does not have such troubles. ​

PHP5.3.3 has integrated php-fpm and is no longer a third-party package. PHP-FPM provides a better PHP process management method, can effectively control memory and processes, and can smoothly reload PHP configuration. It has more advantages than spawn-fcgi, so it is officially included in PHP. PHP-FPM can be turned on by passing the –enable-fpm parameter in ./configure. Use PHP-FPM to control the FastCGI process of PHP-CGI

The master process can understand the following signals

INT, TERM terminate immediately
QUIT smooth termination
USR1 Reopen log file
USR2 smoothly reloads all worker processes and reloads configuration and binary modules

Example:

php-fpm closed:

The code is as follows
 代码如下 复制代码

kill -INT `cat /usr/local/php/var/run/php-fpm.pid`

Copy code

 代码如下 复制代码

kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`

kill -INT `cat /usr/local/php/var/run/php-fpm.pid`

 代码如下 复制代码

ps aux | grep -c php-fpm

php-fpm restart:

View the number of php-fpm processes:
The code is as follows Copy code

 代码如下 复制代码

killall php-fpm

kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`

 代码如下 复制代码

/usr/local/php/sbin/php-fpm &

The code is as follows Copy code

Restart php-fmp (Method 2) Execute first
The code is as follows Copy code
killall php-fpm
Execute again (usr/local/php is the installation directory of php)
The code is as follows Copy code
/usr/local/php/sbin/php-fpm & http://www.bkjia.com/PHPjc/632902.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632902.htmlTechArticleToday I will introduce to you the php-fpm process shutdown and restart commands. PHP-FPM is a PHP FastCGI manager is only used for PHP and PHP5.3.3 has integrated php-fpm, no...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template