这个问题让我疯了,因为php.ini和htaccess中的max_execution_time并且从php报告肯定比警告消息中的reportet更高.
<?php
echo "Max execution time: ".ini_get("max_execution_time")."<br />";
while(true)
{
sleep(1);
}
?>
Run Code Online (Sandbox Code Playgroud)
输出:
最长执行时间:240
致命错误:第5行的C:\ xampp\htdocs\timetest.php超出最长执行时间60秒
回答
是的,这似乎是一个错误:max_input_time会覆盖max_execution_time!
htaccess的:
php_value max_execution_time 240
php_value max_input_time 111
Run Code Online (Sandbox Code Playgroud)
为timetest.php:
<?php
echo "Max execution time: ".ini_get("max_execution_time")."<br />";
echo "Max input time: ".ini_get("max_input_time")."<br />";
while(true)
{
sleep(1);
}
?>
Run Code Online (Sandbox Code Playgroud)
输出(证明):
最长执行时间:240
最大输入时间:111
致命错误:第6行的C:\ xampp\htdocs\timetest.php超过了111秒的最大执行时间
谢谢您的帮助!
php ×1