Page 2 of 2

Posted: Tue Jul 05, 2005 3:44 pm
by Chris Corbyn
OK here's an idea based upon lostboy's inspiration.

Note: You'll need shell access for this to work **

Put the code (be as restrictive as you can here) into it's opwn dedicated PHP script. i.e A script that will do what you need within 30 seconds (using set_time_limit() -- wait for it I havent finished yet ;)).

Execute that script as CLI from within your main file which will need >30 seconds set_time_limit() using something like:

Code: Select all

$result = `php file_to_run.php`; //Note that backticks
Then just examine the output it gives to see if it timed out or not ;)

Could be flaky however.

** Without shell access do:

Code: Select all

file_get_contents('http://localhost/script_to_execute.php'); //Note the HTTP portion
Lemme know what happens ;)

Posted: Tue Jul 05, 2005 4:54 pm
by Deelight
I will give it a try and let you guys know.