See http://php.net/manual/en/function.set-time-limit.php
set_time_limit($seconds)
If $second
is set to 0
, no time limit is imposed. Note that you should be cautious with removing the time limit altogether. You don't want any infinite loops slowly eating up all server resources. A high limit, e.g. 180
is better than no limit.
Alternatively, you can adjust the time setting just for certain blocks of code and resetting the time limit after the time critical code has run, e.g.
$default = ini_get('max_execution_time');
set_time_limit(1000);
... some long running code here ...
set_time_limit($default);