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 backticksCould be flaky however.
** Without shell access do:
Code: Select all
file_get_contents('http://localhost/script_to_execute.php'); //Note the HTTP portion