我从一个在线源下载一个JSON文件,当它通过循环运行时,我得到这个错误:
致命错误:C:\wamp\www\temp\fetch.php第24行超过最大执行时间30秒
我从一个在线源下载一个JSON文件,当它通过循环运行时,我得到这个错误:
致命错误:C:\wamp\www\temp\fetch.php第24行超过最大执行时间30秒
当前回答
我有同样的问题,并通过改变参数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)
我希望这能帮助到你。
其他回答
也许可以检查php.ini文件下更改的任何内容。 例如,我将“;Intl .default_locale =”更改为“;Intl .default_locale = en_utf8”,以便启用“国际化扩展(Intl)”而不添加“extension=php_intl.dll”,然后出现相同的错误。所以我建议检查类似的错误。
我在WordPress网站上也有同样的问题, 我添加了。htaccess文件,然后为我工作很好。
php_value max_execution_time 6000000
使用WHM可以很容易地做到这一点。刚到:
WHM -> Service Configuration -> PHP配置 编辑- > max_execution_time = 30
(30是默认值,更改为任何你想要的值)
set_time_limit($time_in_second); // 0 for unlimited time
如果需要长时间运行脚本,我在运行时使用这个php函数。 详情请点击这里。
通过在PHP脚本顶部添加以下行来增加脚本执行时间。
ini_set('max_execution_time', 120); //120 seconds = 2 minutes
参考已从增加PHP脚本执行时间