php phpMyadmin 中的最长执行时间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1263680/
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-25 01:48:12  来源:igfitidea点击:

Maximum execution time in phpMyadmin

phpmysqldatabasexamppexecution-time

提问by ahmed

When I try to execute (some) queries in phpMyadmin I get this error

当我尝试在 phpMyadmin 中执行(某些)查询时,出现此错误

Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php on line 140

致命错误:第 140 行 C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php 中超出了 60 秒的最大执行时间

because I have a very large table (over 9 millions records)

因为我有一个非常大的表(超过 900 万条记录)

I have edited the file C:\xampp\php\php.ini

我已经编辑了文件 C:\xampp\php\php.ini

and changed the value of "max execution time" from 60 to 1000 then restarts the PHP and still have the same error.

并将“最大执行时间”的值从 60 更改为 1000,然后重新启动 PHP 并仍然出现相同的错误。

Any solution?

有什么解决办法吗?

回答by user1900623

I have the same error, please go to

我有同样的错误,请转到

xampp\phpMyAdmin\libraries\config.default.php

xampp\phpMyAdmin\libraries\config.default.php

Look for : $cfg['ExecTimeLimit'] = 600;

寻找 : $cfg['ExecTimeLimit'] = 600;

You can change '600' to any higher value, like '6000'.

您可以将“600”更改为任何更高的值,例如“6000”。

Maximum execution time in seconds is (0 for no limit).

以秒为单位的最大执行时间是(0 表示没有限制)。

This will fix your error.

这将修复您的错误。

回答by M_R_K

For Xampp version on Windows

对于 Windows 上的 Xampp 版本

Addthis line to xampp\phpmyadmin\config.inc.php

将此行添加xampp\phpmyadmin\config.inc.php

$cfg['ExecTimeLimit'] = 6000;

And Change xampp\php\php.inito

并将xampp\php\php.ini更改为

post_max_size = 750M 
upload_max_filesize = 750M   
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M

And change xampp\mysql\bin\my.ini

并更改xampp\mysql\bin\my.ini

max_allowed_packet = 200M

回答by Sony Mathew

I faced the same problem while executing a curl. I got it right when I changed the following in the php.inifile:

我在执行 curl 时遇到了同样的问题。当我更改php.ini文件中的以下内容时,我做对了:

max_execution_time = 1000 ;

and also

并且

max_input_time = 1000 ;

Probably your problem should be solved by making above two changes and restarting the apache server.

可能您的问题应该通过进行上述两项更改并重新启动 apache 服务器来解决。

Even after changing the above the problem persists and if you think it's because of some database operation using mysql you can try changing this also:

即使在更改上述内容后,问题仍然存在,如果您认为这是因为使用 mysql 进行了某些数据库操作,您也可以尝试更改此设置:

mysql.connect_timeout = 1000 ; // this is not neccessary

All this should be changed in php.ini file and apache server should be restarted to see the changes.

所有这些都应该在 php.ini 文件中更改,并且应该重新启动 apache 服务器以查看更改。

回答by Brian

Your change should work. However, there are potentially few php.ini configuration files with the 'xampp' stack. Try to identify whether or not there's an 'apache' specific php.ini. One potential location is:

你的改变应该有效。但是,可能很少有带有“xampp”堆栈的 php.ini 配置文件。尝试确定是否存在特定于“apache”的 php.ini。一个可能的位置是:

C:\xampp\apache\bin\php.ini

C:\xampp\apache\bin\php.ini

回答by Bill Karwin

Changing php.inifor a web application requires restarting Apache.

更改php.iniWeb 应用程序需要重新启动 Apache。

You should verify that the change took place by running a PHP script that executes the function phpinfo(). The output of that function will tell you a lot of PHP parameters, including the timeout value.

您应该通过运行执行该函数的 PHP 脚本来验证更改是否发生phpinfo()。该函数的输出会告诉您很多 PHP 参数,包括超时值。

You might also have changed a copy of php.inithat is not the same file used by Apache.

您可能还更改了php.ini与 Apache 使用的文件不同的副本。

回答by Karthikeyan

ini_set('max_execution_time', 0);or create file name called php.iniand enter the first line max_execution_time=0then save it and put the file in your root folder of your application.

ini_set('max_execution_time', 0);或创建文件名php.ini并输入第一行,max_execution_time=0然后保存并将文件放在应用程序的根文件夹中。

That's it. Good luck.

就是这样。祝你好运。

回答by Olasunkanmi

Well for Wamp User,

对于 Wamp 用户来说,

Go to: wamp\apps\phpmyadmin3.3.9\libraries

去: wamp\apps\phpmyadmin3.3.9\libraries

Under line 536, locate $cfg['ExecTimeLimit'] = 0;

在第 536 行下, locate $cfg['ExecTimeLimit'] = 0;

and change the value from 0 to 6000. e.g

并将值从 0 更改为 6000。例如

$cfg['ExecTimeLimit'] = 0;

To

$cfg['ExecTimeLimit'] = 6000;

Restart wamp server and phew.

重新启动 wamp 服务器和呼。

It works like magic !

它的作用就像魔术一样!

回答by andymnc

In php.ini you must check mysql.connect_timeout either. That's responsible for socket closing and returning the Fatal. So, for example, change it to:

在 php.ini 中,您也必须检查 mysql.connect_timeout。这负责关闭套接字并返回 Fatal。因此,例如,将其更改为:

mysql.connect_timeout = 3600

That time will be always counted in seconds, so in my example you have 1 hour.

该时间将始终以秒为单位计算,因此在我的示例中,您有 1 小时。

回答by Casso

What worked for me on WAMP was modifying file: \Wamp64\alias\phpmyadmin.conf, lines:

在 WAMP 上对我有用的是修改文件:\Wamp64\alias\phpmyadmin.conf,行:

 php_admin_value max_execution_time 600
 php_admin_value max_input_time 600

I did not have to change the library file.

我不必更改库文件。

回答by Jamal

Probabily you are using XMAPP as service, to restart XMAPP properly, you have to open XMAPP control panel un-check both "Svc" mdodules against Apache and MySQL. Then click on exit, now restart XMAPP and you are done.

可能您正在使用 XMAPP 作为服务,要正确重启 XMAPP,您必须打开 XMAPP 控制面板,取消选中针对 Apache 和 MySQL 的“Svc”模块。然后点击退出,现在重启 XMAPP 就完成了。