Home > Backend Development > PHP Problem > How to turn off php fpm in linux

How to turn off php fpm in linux

藏色散人
Release: 2023-03-05 07:40:01
Original
2293 people have browsed it

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.

How to turn off php fpm in linux

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
Copy after login

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
Copy after login

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
Copy after login

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:

How to turn off php fpm in linux

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
Copy after login

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!

Related labels:
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