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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29552583/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 00:28:09  来源:igfitidea点击:

Maximum execution time of 300 seconds in Xampp on Windows

phpapachexampp

提问by Shan

I have changed php.inisettings and max timeoutin http-default.confunder apache but still I get the following error:

我已经更改了php.ini设置并max timeouthttp-default.confapache 下,但仍然出现以下错误:

Maximum execution timeout of 300 seconds

I have even added set_time_limitand ini_setto the php script but still I get this error.

我什至已将set_time_limit和添加ini_set到 php 脚本中,但仍然出现此错误。

How do I resolve this?

我该如何解决?

Note:

笔记:

I tried the options in Fatal error: Maximum execution time of 300 seconds exceeded.

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

回答by Leandro Papasidero

Change Maximum Execution Time

更改最长执行时间

php.ini

配置文件

max_execution_time = 30

From Code

从代码

Start your code with,

开始你的代码,

ini_set('MAX_EXECUTION_TIME', 3600);

.htaccess

.htaccess

php_value max_execution_time 3600

No matter which option you choose, restart Apache service.

无论您选择哪个选项,都要重新启动 Apache 服务。

回答by bob_1982

use below thing and i think will work

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

set_time_limit(0);

回答by Noor Ahmed

Conditions:

状况:

If you are using phpMyadmin to import large sql files and you have increased max_execution time, max file upload limit and everything needed And If none of the above answers work for you come here

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

Go to your server (xampp or wamp) folder, in my case here is the relative path to the file that I need to modify: C:\xampp\phpMyAdmin\libraries\config.default.php

转到您的服务器(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;

回答by andymnc

In php.ini you must check mysql.connect_timeout either. So, for example, change it to:

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

mysql.connect_timeout = 1000

That time will be always counted in seconds

那个时间总是以秒计算