致命错误:超过300秒的最大执行时间 [英] Fatal error: Maximum execution time of 300 seconds exceeded
问题描述
我不断收到此PHP错误:
I keep getting this PHP error:
致命错误:超过300秒的最大执行时间
Fatal error: Maximum execution time of 300 seconds exceeded
我尝试将php.ini(Apache和cli)中的max_execution_time
和max_input_time
设置分别设置为0
,-1
和4000
秒.
I have tried setting my max_execution_time
and my max_input_time
settings in php.ini (both apache and cli) to 0
, -1
and 4000
seconds each.
我仍然收到错误消息:
致命错误:最长执行时间超过300秒
Fatal error: Maximum execution time of 300 seconds exceeded
在收到此消息之前,我的脚本运行了300秒以上
As well my script runs over 300 seconds before i get this message
我正在通过命令行运行脚本.
I am running the script through command line.
我还检查了我的phpinfo()
,所以请查看我正在使用哪个php.ini
.
I also checked my phpinfo()
so see which php.ini
I am using.
更有趣的是,我尝试将max_execution_time
和max_input_time
设置设置为5秒,并且我的脚本将在运行5秒后运行:
Even more interesting I have tried setting max_execution_time
and max_input_time
settings to 5 second and my script will run way beyond 5 seconds before I get the:
致命错误:超过300秒的最大执行时间
Fatal error: Maximum execution time of 300 seconds exceeded
推荐答案
您可以在脚本的开头添加
At the beginning of your script you can add.
ini_set('MAX_EXECUTION_TIME', '-1');
这篇关于致命错误:超过300秒的最大执行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!