How to close php fpm in Linux: First copy the init file of "php-fpm" in the source code to the system; then use the command "service php-fpm stop" to close php fpm.
Recommended: "PHP Video Tutorial"
Close the php-fpm process:
You can copy the init file of php-fpm from the source code to the system:
cp -f sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
Then you can use the following commands to start, stop, restart and reload php-fpm:
service php-fpm start service php-fpm restart service php-fpm stop service php-fpm reload
The extreme method is to use killall. When the following content appears, it means that all php-fpm processes have been killed:
[root@test ~]# killall php-fpm php-fpm: no process found
I recommend starting each site under php-fpm Independent processes, using different users and groups simultaneously for increased security. After startup, it looks like this:
When viewed using ps, it looks like this:
[root@web ~]# ps -aux | grep php root 1575 0.0 0.0 246668 7100 ? Ss Apr13 0:08 php-fpm: master process (/usr/local/php7/etc/php-fpm.conf) mysqltc+ 1577 0.0 0.0 246660 6712 ? S Apr13 0:00 php-fpm: pool mysqltcom root 4318 0.0 0.0 112652 960 pts/1 S+ 01:12 0:00 grep --color=auto php zabbixt+ 18183 0.0 0.1 252160 15888 ? S Apr15 0:04 php-fpm: pool zabbixtcom zabbixt+ 19337 0.0 0.1 252136 15780 ? S Apr15 0:01 php-fpm: pool zabbixtcom
So your method of using killall is correct:
[root@test ~]# killall php-fpm
The above is the detailed content of How to turn off php fpm in linux. For more information, please follow other related articles on the PHP Chinese website!