phpMyAdmin 配置
- 如何增加 phpmyadmin 会话超时?
- 如何增加 phpmyadmin 导入文件大小限制(目前显示最大:2,048KiB)。我尝试更改
php.ini
中的upload_max_filesize
但没有任何区别。
- How do I increase phpmyadmin session timeout?
- How do I increase phpmyadmin import file size limit(currently it says Max: 2,048KiB). I tried changing
upload_max_filesize
inphp.ini
but it didn't make any difference.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
config.inc.php > > $cfg['LoginCookieValidity'] = 3600 * 9; // 9 小时
从 ajreal 发布的链接进行编辑:
更改后第二个问题的 LoginCookieValidity php.ini 中的 upload_max_filesize 您是否重新启动了 apache(或您使用的任何网络服务器)?
config.inc.php >
$cfg['LoginCookieValidity'] = 3600 * 9; // 9 hours
edit from the link posted by ajreal: LoginCookieValidity
for the second question , after changing upload_max_filesize in php.ini did you restart apache ( or whatever webserver you use ) ?
如何将 phpMyAdmin 默认 1440 秒超时设置得更高:
找到 php.ini
以 root 身份打开文件进行编辑,找到这一行:
将其更改为这样(500000秒是5.7天)
重启apache。 重新启动阿帕奇
这样做会降低安全性,因为这样会增加跨站点脚本和中间人攻击的机会。这一切都很有趣,直到您发现您的服务器是信用卡僵尸网络的一部分。
How to set phpMyAdmin default 1440 second timeout higher:
locate php.ini
open the file as root to edit, find this line:
Change it to this (500000 seconds is 5.7 days)
Restart apache.
Doing this decreases security because then it increases opportunity for cross site scripting and man in the middle attacks. It's all fun and games until you find your server is part of a botnet farming for credit cards.
最好将以下内容添加到您的 config.inc.php 文件中,而不是在 php.ini 文件中设置 session.gc_maxlifetime /etc/phpmyadmin 目录):
这样您就不会危及其他 PHP 脚本的安全性,也不会因不频繁的垃圾收集而导致 RAM 中出现过度混乱。
Rather than setting session.gc_maxlifetime in the php.ini file, better to add the following to your config.inc.php file (typically in the /etc/phpmyadmin directory):
That way you don't compromise security for other PHP scripts, or cause excessive clutter in the RAM due to infrequent Garbage Collection.
编辑 phpMyAdmin 的
config.inc.php
并添加或更新LoginCookieValidity
值,如下所示:要上传超过 2M: p>
在
php.ini
中搜索upload_max_filesize
,并将值更改为64M
(对于 64 Mb):保存并退出。
重新启动
apache
:完成!
Edit phpMyAdmin's
config.inc.php
and add or updateLoginCookieValidity
the value as follows:To upload more than 2M:
Search for
upload_max_filesize
inphp.ini
, and change value to64M
(for 64 Mb):Save and exit.
Restart
apache
:Finish!
对于第一个问题,您需要更改 config.inc.php 中的
$cfg['LoginCookieValidity']
配置。打开 phpMyAdmin“根”目录中的 config.inc.php。查找包含以下内容的行:$cfg['LoginCookieValidity']。将值设置为所需的秒数。如果该行不存在,只需按如下方式添加:
您将需要再次登录 phpmyadmin。
这还假设 PHP 会话垃圾收集已相应设置。这可以通过多种方式完成:
session.gc_maxlifetime =
php_admin_value session.gc_maxlifetime
ini_set('session.gc_maxlifetime',);
关于第二个问题:
您需要更改两者,
upload_max_filesize
和 php.ini 中的post_max_size
。post_max_size
值必须至少为upload_max_filesize
值。不要忘记重新启动服务器
参考
For the first question, you need to change the
$cfg[‘LoginCookieValidity’]
config in the config.inc.php.Open config.inc.php in the phpMyAdmin “root” directory. Look for a line that contains this: $cfg[‘LoginCookieValidity’]. Set the value to the desired amount of seconds. If the line doesn't exist, just add it like this:
You will need to login again to phpmyadmin.
This also assumes that the PHP session garbage collection is set-up accordingly. This can be done in a number of ways:
session.gc_maxlifetime = <seconds>
php_admin_value session.gc_maxlifetime <seconds>
ini_set(‘session.gc_maxlifetime’, <seconds>);
About the second question:
You need to change both,
upload_max_filesize
andpost_max_size
in your php.ini.The
post_max_size
value needs to be at least theupload_max_filesize
value.Don't forget to restart your server
Reference
尝试更改
/etc/php.ini
文件中的post_max_size
。Try by changing
post_max_size
in/etc/php.ini
file.https://wiki.phpmyadmin。净/pma/phpMyAdmin_configuration_file
https://wiki.phpmyadmin.net/pma/phpMyAdmin_configuration_file
我知道这篇文章已经得到解答,但我刚刚解决了同样的问题,所以我想我会添加我的发现来帮助其他人。
我需要将 PhpMyAdmin 上传文件大小限制从默认值 2,048KiB 增加,我也更改了 upload_max_filesize 、 post_max_size 和 memory_limit ,但没有任何改变。
当我使用 phpinfo(); 时,我花了一段时间才发现问题。脚本来识别 PHP.ini 文件的位置据说在这里:C:\Program Files (x86)\iisexpress\PHP\v5.5\php.ini,但我终于在 PhpMyAdmin 主页中注意到 Web 服务器是运行版本:5.6.31。因此,我更新了 5.5 和 5.6 版本的 PHP.ini 中的上传、发布和内存限制,并增加了 PhpMyAdmin 中的导入限制。
I'm aware this post has been answered, but I've just resolved the same issue, so I thought I would add my findings to help others.
I needed to increase the PhpMyAdmin upload file size limit from default the 2,048KiB and I too changed the upload_max_filesize and post_max_size and memory_limit, but nothing changed.
It took my a while to find the problem, when I used the phpinfo(); script to identify where the PHP.ini file was it said was here: C:\Program Files (x86)\iis express\PHP\v5.5\php.ini, but I finally noticed in the PhpMyAdmin homepage that the Web server was running version: 5.6.31. So, I updated the upload, post and memory limits in the PHP.ini for both versions 5.5 and 5.6 and the import limit in PhpMyAdmin increased.
编辑 phpMyAdmin 的
config.inc.php
并添加或更新LoginCookieValidity
值,如下所示:在 wamp 或 xampp 或您在
php.ini
中使用的任何内容中,搜索
upload_max_filesize
这是您应该更改的地方,我们建议您不要使用超过64M的文件大小,因为有时会导致崩溃:
保存并退出。
Edit phpMyAdmin's
config.inc.php
and add or updateLoginCookieValidity
the value as follows:In wamp or xampp or anything you use at
php.ini
,Search for
upload_max_filesize
this is where you should change it,we suggest you not use more than 64M filesize cause sometimes it makes crash:
Save and exit.
我在 Poelinca 的回答中补充说,这个限制的机制可以在
libraries/Config.class.php
下的 PMA 源代码中找到,function checkUploadSize()
它将使用
upload_max_filesize
如果已定义,则为 5M,如果还定义了max_upload_size
,则将获取两者中的最小值。(PMA 版本 3.3.7deb7)
I add to Poelinca's answer that the mechanism of this limit can be found in the PMA sources under
libraries/Config.class.php
,function checkUploadSize()
It will use
upload_max_filesize
if defined or 5M else and ifmax_upload_size
is also defined it will get the min of the two.(PMA version 3.3.7deb7)