开发者

php max_execution_time value is 30seconds but run 200seconds?

im getting php maximum execution time like this.

开发者_运维百科
<?php ini_get('max_execution_time'); ?>
output: 30

but i can run this script.

<?php 
sleep(200);
echo "no timeout error";
?>
output: no timeout error

im how to get real ini value ?

best regards


From the manual:

The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running.

Since sleep is a system call, it doesn't count against the max execution time.


Your max_exec_time IS 30 seconds, but it's not timeouting because time is not running in sleep() but only when script is doing something

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜