After the PHP-FPM is installed, there is no end command that comes with it, which can be done in the following ways:
1. First check the PHP-FPM process number:
PS grep php-fpm
You can see that the master process number is 91790 and there are two child processes, so when the parent process ends, the child process ends up with the following command:
Kill 91791
After kill, the PHP-FPM is finished, and then configured, the boot is ready.
2, this method is the recommended method can smooth end and restart the PHP-FPM process, the method is as follows:
First kill the process according to Method 1, and then use vim etc/php-fpm.conf to open the configuration file
Remove the semicolon in front of the PID and generate the PID file by default at run time
Then save and exit, using the sbin/php-fpm boot process can be found under/usr/local/php/var/run php-fpm.pid file, the file is stored in method 1 using the command to see the process number
At this point, the process ends and the restart operation is possible.
Terminate process immediately: kill -int 'cat /usr/local/php/var/run/php-fpm.pid '
Smooth termination process: kill -quit 'cat /usr/local/php/var/run/php-fpm.pid '
Smooth restart process: kill -usr2 'cat /usr/local/php/var/run/php-fpm.pid '
Note that the above 3 commands are used to refer to the file, the recommended way in production is to smoothly reload the PHP-FPM all worker processes, configuration, and binary modules using the third command
View PHP-FPM the number of processes can be counted using the-c parameter of the pipe, the command is: ps aux | grep -C php-fpm or PS -ef | grep -C php-fpm
Statistics come out of the hypothesis is 4, then the actual number of processes except grep itself is a total of 3 processes
Common operations for PHP-FPM