I've got a script which uses cURL to connect to another website, and it seems to be getting stuck (I can't quite figure out how, but that's besides the point!). The trouble is that when my script runs it redirects you to a "please wait" page, and it then executes by itself. So you can't click 'stop' in your browser to terminate the script. If the script gets a fatal error, then the 'results' page will display an error saying that the script failed. If the script finishes successfully then obviously the 'results' page will have the results on it.
But my script appears to get stuck, and just never produces a results page, and never produces an error. So it must still be executing. The script wouldn't necessarily time out because time spent doing cURL connections doesn't count towards the script's execution time. And despite my cURL settings, cURL doesn't seem to timeout either. So my script is stuck in eternal limbo, which worries me because I've now probably got several scripts all running forever on my webserver! (Deleting the php file doesn't help, because php appears to store it in ram in order to execute it, so it keeps running even after you've deleted it.)
So to get to the point.....
How can I get php to terminate everything its doing (i.e. all scripts that its running) without shutting down the webserver? I can't shut down the web server because it's on a paid hosting thing, and I don't have that kind of access to it (only cpanel).
What are 'cron jobs'? Could I create one that resets php?
But my script appears to get stuck, and just never produces a results page, and never produces an error. So it must still be executing. The script wouldn't necessarily time out because time spent doing cURL connections doesn't count towards the script's execution time. And despite my cURL settings, cURL doesn't seem to timeout either. So my script is stuck in eternal limbo, which worries me because I've now probably got several scripts all running forever on my webserver! (Deleting the php file doesn't help, because php appears to store it in ram in order to execute it, so it keeps running even after you've deleted it.)
So to get to the point.....
How can I get php to terminate everything its doing (i.e. all scripts that its running) without shutting down the webserver? I can't shut down the web server because it's on a paid hosting thing, and I don't have that kind of access to it (only cpanel).
What are 'cron jobs'? Could I create one that resets php?
Comment