You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PHP脚本300秒后终止,php.ini已设置max_execution_time=2400

PHP 8 XAMPP环境中max_execution_time设置失效问题

环境与测试细节

  • 本地运行环境:搭载PHP 8的XAMPP
  • 测试1:执行代码 echo ini_get('max_execution_time');,输出结果为2400,与php.ini中的设置值一致
  • 测试2:执行以下代码
    echo "Max execution time: ".ini_get("max_execution_time")."<br />";
    echo "Max input time: ".ini_get("max_input_time")."<br />";
    
    输出结果:Max execution time: 2400<br>Max input time: 60
  • 测试3:执行代码 ini_set('MAX_EXECUTION_TIME', '-1'); 后问题未解决,仍然抛出错误:

    致命错误:超过300秒的最大执行时间,错误位置:C:\xampp\htdocs..\inc\datenbank.php 第xx行

内容的提问来源于stack exchange,提问作者Thomas Kujawa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 06:29:57