开发者

How do i make a Php script terminate after a fixed amout of time

How do i make a Php scrip开发者_C百科t terminate after a fixed amount of time


Using the max_execution_time setting in PHP.

Ie:

ini_set('max_execution_time', 30);

Would end the script after 30 seconds of execution (this is default in PHP)

You could also use:

set_time_limit(30);

See: http://php.net/manual/en/function.set-time-limit.php and http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time


I would use the set_time_limit() function which specifies the amount of time a script is allowed to run after the point at which this function has been called.

More info here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜