In case you are looping, you could just do the following:
$starttime = time();
...
foreach (....) { // your loop
// your active code here
....
if (time() - $starttime) > 120) break;
}
Would be the simplistic approach.
maba001
Junior Poster in Training
60 posts since Jun 2008
Reputation Points: 9
Solved Threads: 9
Hello again,
it might be that the set_time_limit(0) call gets honored. This would explain why it runs that long. Actually I don't know how reliable the time limit really is. I have seen similar behavior but only in cases where I do system calls to external helpers. In such a case if the external program does not return, the server might kill the connection (the httpd that is) but the PHP script itself still runs. So you won't see the timeout. But -- not really sure, this is just something I have seen happening.
maba001
Junior Poster in Training
60 posts since Jun 2008
Reputation Points: 9
Solved Threads: 9