Windows Xampp 中的最长执行时间为 300 秒

Maximum execution time of 300 seconds in Xampp on Windows

我已经在 apache 下的 http-default.conf 中更改了 php.ini 设置和 max timeout,但我仍然收到以下错误:

Maximum execution timeout of 300 seconds

我什至在 php 脚本中添加了 set_time_limitini_set,但我仍然收到此错误。

我该如何解决这个问题?

注:

我尝试了 Fatal error: Maximum execution time of 300 seconds exceeded 中的选项。

更改最大执行时间

php.ini

max_execution_time = 30

来自代码

开始你的代码,

ini_set('MAX_EXECUTION_TIME', 3600);

.htaccess

php_value max_execution_time 3600

无论选择哪个选项,重启Apache服务。

使用下面的东西,我认为会起作用

set_time_limit(0);

在 php.ini 中,您也必须检查 mysql.connect_timeout。 因此,例如,将其更改为:

mysql.connect_timeout = 1000

那个时间总是以秒计算

条件:

如果您使用 phpMyadmin 导入大型 sql 文件并且您增加了 max_execution 时间、最大文件上传限制和所需的一切 如果上述 none 个答案对您有用,请来这里

转到您的服务器(xampp 或 wamp)文件夹,在我的例子中,这里是我需要修改的文件的相对路径:C:\xampp\phpMyAdmin\libraries\config.default.php

/**
  * maximum execution time in seconds (0 for no limit)
  * 
  * @global integer $cfg['ExecTimeLimit']
  * by defautlt 300 is the value
  * change it to 0 for unlimited 
  * time is seconds
  * Line 709 for me
*/
 $cfg['ExecTimeLimit'] = 0;