My problem is that I have a command running in the shell and I want to stop it from PHP (using shell_exec ). I found this
pkill [name of command]
and it works fine when the command is composed of one word.
shell_exec('pkill ping');
but my command is 'npm run test bla bla bla ' I tried also to get the pid of my running process using
pgrep [name of command]
and then use kill -9 but this doesn't work because I have also a command with more than 1 word. Thank you