[英]phpMyAdmin timeout not respecting PHP.ini max_execution_time
Trying to import a 150MB.sql.zip file into WAMP phpMyAdmin
using this method (saving the import file in c:/wamp/sql, and editing C:\wamp\apps\phpmyadmin5.0.2\config.inc.php
to include $cfg['UploadDir'] = 'C:\wamp\sql';
最后,在导入过程中选择导入文件保存到C:\wamp\sql
。
但是,我在 phpMyAdmin 中不断收到超时错误,建议选择相同的文件重新运行导入,但在第二次运行时,我总是收到 SQL 错误。
因此,我在 Wamp 的PHP.ini
中设置了max_execution_time = 4500
(4500 秒等于 75 分钟)并重新启动了 Apache 和 Z62A004B959146BB97541AFA46BB97541AFA43。
但是,使用相同的导入过程时会出现相同的超时错误。 大约 5 分钟后发生超时错误。
为什么超时错误发生在 5 分钟内,而不是在 PHP.ini max_execution_time = 4500
设置的时间内?
编辑
phpinfo 说 localhost 有:
memory_limit 200M
post_max_size 200M
upload_max_filesize 200M
max_execution_time 4500
我继续收到发生超时的消息,并使用相同的文件再次重新运行导入,但在第二次运行时,我收到一个错误:
错误Static分析:
2 errors were found during analysis.
Unexpected beginning of statement. (near "RT" at position 0)
Unrecognized statement type. (near "INTO" at position 3)
SQL query: Copy
RT INTO `cache_menu`
看起来 SQL INSERT 命令正在被进程剪切。
如何安全地将 SQL 分成更小的块?
除了最大执行时间外,PHP 还将限制帖子最大大小、memory 限制、上传最大文件大小。 (都可以与数据导入的上传文件操作相关)。 如果其中任何一个达到允许的限制,将导致执行失败并抛出超时错误
因此,您可以设置/更改以下内容
ini_set('memory_limit', '40M');
ini_set('max_execution_time', 80000);
ini_set('post_max_size', '40M');
ini_set('upload_max_filesize', '40M');
我不确定这对于遇到相同问题的人来说是否是一个足够的解决方案,但我的解决方法是使用SQL 转储文件拆分器将大型 SQL 文件拆分为较小的文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.