简体   繁体   中英

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.

您的max_exec_time是30秒,但是它没有超时,因为时间没有在sleep()中运行,只有在脚本正在执行某项操作时

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM