To kill all PHP Processes
kill $(ps aux | grep ‘[p]hp’ | awk ‘{print $2}’)
kill specific php -fpm fool
TO kill Php fpm process
sudo pkill php-fpm
killall -KILL php-fpm
To kill all php-fpm for all users
sudo pkill php-fpm: pool sarkari
To kill all Nginx Processes
kill $(ps aux | grep '[n]ginx' | awk '{print $2}')
To kill all MySQL Processes
kill $(ps aux | grep ‘[m]ysql’ | awk ‘{print $2}’)
Just make sure you replace [p]hp with name of that process. Remember to keep first letter in bracket.
ps -aux | grep php-fpm
root@murali:~# ps -aux | grep php-fpm
root 4135329 0.0 0.9 634608 37420 ? Ss 05:02 0:00 php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf)
www-data 4135331 1.6 5.9 832888 240928 ? S 05:02 0:05 php-fpm: pool sarkari
www-data 4135332 1.8 6.0 832656 244008 ? S 05:02 0:06 php-fpm: pool sarkari
www-data 4135333 1.6 6.9 835680 279644 ? S 05:02 0:05 php-fpm: pool sarkari
www-data 4135421 2.6 5.9 863420 238300 ? S 05:04 0:06 php-fpm: pool sarkari
www-data 4135431 1.5 6.2 832776 251928 ? S 05:04 0:03 php-fpm: pool sarkari
www-data 4135599 0.9 3.8 722016 155360 ? S 05:07 0:00 php-fpm: pool www
www-data 4135606 0.7 3.6 647404 148648 ? S 05:07 0:00 php-fpm: pool www
www-data 4135609 1.1 2.4 652368 98428 ? S 05:07 0:00 php-fpm: pool murali