views:

173

answers:

5

I got a PHP script that is looping and will continue to do so for about another hour. How do I stop it. The script explicitly overrides the time out and the memory buffer. It's on a shared hosting server with cPanel installed. The entire website is down until the script completes.

I had added a usleep(100000) statement, but it doesn't appear to work.

+2  A: 

If the script already runs you can't do anything except killing the process/webserver/host and restarting it.

ZeissS
A: 

Think the moral is, never override them, just lift them up to a higher level.

Rich Bradshaw
It's a crawler. I don't want it stopping any soon.
gAMBOOKa
You could lift the execution time to a nicer level (3 hours or something), then end and restart the process when it finishes a job within a certain time from that.
Rich Bradshaw
A: 

Try SSH into your server (use the login information you use for FTP or contact your host for details), locate the process and kill it. You should be able to locate it using the top command and the process is probably called php or httpd. There is a problem: there could be various such process running and you can't just go about killing all of them!

Salman A
+1  A: 

First contact your host and ask them to kill the process. This is the best and simple way.

Vinothbabu
+1  A: 
VAC-Prabhu