linux - How to kill all PHP-FPM processes in a single command line

ID : 274304

viewed : 35

Tags : linuxprocessphplinux





Top 4 Answer for linux - How to kill all PHP-FPM processes in a single command line

vote vote

92

You can use killall instead, it takes a process name instead of a PID

killall -KILL php-fpm 

ps: -9 and -KILL are the same

vote vote

82

if who get problem like me:

-bash: killall: command not found 

you can use:

sudo kill -9 `sudo ps -ef | grep php-fpm | grep -v grep | awk '{print $2}'` 

I found this command here: https://gist.github.com/bmichalski/c8d25fff041a4739d6f0126edb0e9b54 , it worked for me.

vote vote

72

If you are having issues where killall is not a command on your environment, I would recommend the following:

To kill all php-fpm for your user

pkill php-fpm 

To kill all php-fpm for all users

sudo pkill php-fpm 
vote vote

63

Top 3 video Explaining linux - How to kill all PHP-FPM processes in a single command line







Related QUESTION?