我从一个在线源下载一个JSON文件,当它通过循环运行时,我得到这个错误:
致命错误:C:\wamp\www\temp\fetch.php第24行超过最大执行时间30秒
我从一个在线源下载一个JSON文件,当它通过循环运行时,我得到这个错误:
致命错误:C:\wamp\www\temp\fetch.php第24行超过最大执行时间30秒
当前回答
你的循环可能是无止境的。如果不是,你可以像这样延长最大执行时间:
ini_set('max_execution_time', '300'); //300 seconds = 5 minutes
and
set_time_limit(300);
可用于临时延长时间限制。
其他回答
编辑php . ini
找到这条线:
max_execution_time
将其值改为300:
max_execution_time = 300
300表示HTTP请求的执行时间为5分钟。
使用WHM可以很容易地做到这一点。刚到:
WHM -> Service Configuration -> PHP配置 编辑- > max_execution_time = 30
(30是默认值,更改为任何你想要的值)
我在我的案例中做了一些更改:xampp\phpMyAdmin\libraries\config.default.php
我已经搜索了:$cfg['ExecTimeLimit'],并更改右侧的值…
您可以将右手值更改为任何更高的值,如“5000”。这很有效。
通过在PHP脚本顶部添加以下行来增加脚本执行时间。
ini_set('max_execution_time', 120); //120 seconds = 2 minutes
参考已从增加PHP脚本执行时间
我有同样的问题,并通过改变参数max_execution_time在php.ini中的值来解决它,就像这样:
max_execution_time = 360 ; Maximum execution time of each script, in seconds (I CHANGED THIS VALUE)
max_input_time = 120 ; Maximum amount of time each script may spend parsing request data
;max_input_nesting_level = 64 ; Maximum input variable nesting level
memory_limit = 128M ; Maximum amount of memory a script may consume (128MB by default)
我希望这能帮助到你。