I have a php script running in an infinite loop that I need killed without restarting apache.
I have access to the server via remote desktop. Please advise.
I have a php script running in an infinite loop that I need killed without restarting apache.
I have access to the server via remote desktop. Please advise.
Find the running scripts you want to kill:
tasklist /v | find "php"
Make note of the process ID, kill it with:
taskkill /PID 3776
Same as doing:
ps aux | grep php kill 3776
Have you tried:
Windows task manager->Processes->apache ?
It should be there, simply end the process.
EDIT -
Just saw that you don't want to kill apache.
I'm not sure that's possible, as PHP runs as an apache module I believe.
In the task manager look for the apache "fork" that takes 100% of the CPU, then kill it.
You can try this: https://serverfault.com/questions/229435/how-to-break-from-infinite-loop-caused-by-php-script-running-as-root
For future, make sure to have some secure file lock for the script:
while(true) //script loop { if(file_exists("STOP")) { unlink("STOP"); exit; } /*Do some work*/
}