Click to See Complete Forum and Search --> : how do I make a script time-out after so long?


mitya
11-30-2003, 09:53 AM
Hi

My server's crashing occasionally under some pretty strenuous coding which fetches remote images and pages and scans the lot for colours, often pixel by pixel. It's usually fine, but sometimes hangs when calling difficult servers.

Is there a common way to stop a script if it hasn't returned the desired result after so long?

Thanks in advance.

pyro
11-30-2003, 10:06 AM
Yes, set_time_limit() (http://us4.php.net/set_time_limit) should do that for you.

mitya
11-30-2003, 10:29 AM
Thanks P- searched the manual for the string 'timeout' but don't remember seeing that one.

Cheers.

pyro
11-30-2003, 01:23 PM
Happy to help. :)