I write shell script that runs PHP process. But it was not running in background. Can I kill the shell script without killing the PHP process which is running?
Yes, but you have to separate it first. To separate the child from the parent process, run:
kill -20 PID
kill -18 PID
If you are on the same terminal with the process, type
ctrl-z to stop the parent, and the use
ps -ef to find the PID of the php child. Use the kill lines above to effectively separate the child from the parent. Then
fg back into your shell script and it should terminate normally, or you can
kill -9 the shell script by PID or name directly while you are at the prompt. Otherwise, killing the parent will (eventually) take out the child.