dez*_*dez 75 php command-line-interface
我一直收到这个PHP错误:
致命错误:超出最长执行时间300秒
我已经尝试在php.ini(apache和cli)中设置我max_execution_time和我的max_input_time设置0,-1以及4000每个设置秒.
我仍然得到错误说:
致命错误:超出最长执行时间300秒
在我收到此消息之前,我的脚本运行超过300秒
我通过命令行运行脚本.
我也检查了我phpinfo(),看看php.ini我正在使用哪个.
更有趣的是我尝试将设置 max_execution_time和max_input_time设置设置为5秒,我的脚本将在5秒内运行,然后才得到:
致命错误:超出最长执行时间300秒
Vip*_*bey 84
如果您正在使用WAMP转到:
增加max_execution_time中php.ini然后去
C:\wamp\apps\phpmyadmin3.4.10.1\libraries (根据您的安装更改路径)
打开config.default.php并将值更改为$cfg['ExecTimeLimit']0:
$cfg['ExecTimeLimit'] = 0;
Run Code Online (Sandbox Code Playgroud)
这将解决PhpMyAdmin导入的问题.
Tul*_*les 59
在脚本的开头,您可以添加.
ini_set('MAX_EXECUTION_TIME', '-1');
Run Code Online (Sandbox Code Playgroud)
Tec*_*nic 53
Xampp用户
xampp\phpMyAdmin\$cfg['ExecTimeLimit'] = 300;$cfg['ExecTimeLimit'] = 0;(或更大的值)xia*_*kai 24
我遇到了类似的情况,事实证明Codeigniter(我正在使用的PHP框架)实际上设置了自己的时间限制:
在system/core/Codeigniter.php中,版本2.1.3中的第106行出现以下内容:
if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0)
{
@set_time_limit(300);
}
Run Code Online (Sandbox Code Playgroud)
由于没有其他方法可以避免更改核心文件,因此我将其删除以便允许通过php.ini进行配置,并为CLI请求提供无限的最长执行时间.
我建议在未来CI版本升级的情况下记录此更改.
在脚本中尝试以下内容:
set_time_limit(1200);
Run Code Online (Sandbox Code Playgroud)
小智 8
对于 Xampp 用户
1. Go to C:\xampp\phpMyAdmin\libraries
2. Open config.default.php
3. Search for $cfg['ExecTimeLimit'] = 300;
4. Change to the Value 300 to 0 or set a larger value
5. Save the file and restart the server
6. OR Set the ini_set('MAX_EXECUTION_TIME', '-1'); at the beginning of your script you can add.
Run Code Online (Sandbox Code Playgroud)
这是正确的答案:
去
c:\wamp\apps\phpmyadmin3.4.10.1\libraries\config.default.php
Run Code Online (Sandbox Code Playgroud)
找到并设置
$cfg['ExecTimeLimit'] = 0;
Run Code Online (Sandbox Code Playgroud)
重启所有服务并完成.
小智 5
转到xampp / phpmyadmin / libraries / config.default.php
并进行以下更改
from $cfg['ExecTimeLimit'] = ’300?;
to $cfg['ExecTimeLimit'] = ’0?;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
188061 次 |
| 最近记录: |