phpMyAdmin 配置

发布于 2024-10-05 19:26:14 字数 164 浏览 7 评论 0原文

  • 如何增加 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 in php.ini but it didn't make any difference.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

夏末 2024-10-12 19:26:14

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 ) ?

怎樣才叫好 2024-10-12 19:26:14

如何将 phpMyAdmin 默认 1440 秒超时设置得更高:

  1. 找到 php.ini

    el@apollo:/var/lib/phpmyadmin$ 定位 php.ini
    /etc/php5/apache2/php.ini
    
  2. 以 root 身份打开文件进行编辑,找到这一行:

    session.gc_maxlifetime = 1440
    
  3. 将其更改为这样(500000秒是5.7天)

    session.gc_maxlifetime = 500000
    
  4. 重启apache。 重新启动阿帕奇

这样做会降低安全性,因为这样会增加跨站点脚本和中间人攻击的机会。这一切都很有趣,直到您发现您的服务器是信用卡僵尸网络的一部分。

How to set phpMyAdmin default 1440 second timeout higher:

  1. locate php.ini

    el@apollo:/var/lib/phpmyadmin$ locate php.ini
    /etc/php5/apache2/php.ini
    
  2. open the file as root to edit, find this line:

    session.gc_maxlifetime = 1440
    
  3. Change it to this (500000 seconds is 5.7 days)

    session.gc_maxlifetime = 500000
    
  4. 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.

咋地 2024-10-12 19:26:14

最好将以下内容添加到您的 config.inc.php 文件中,而不是在 php.ini 文件中设置 session.gc_maxlifetime /etc/phpmyadmin 目录):

ini_set('session.gc_maxlifetime', '86400');

这样您就不会危及其他 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):

ini_set('session.gc_maxlifetime', '86400');

That way you don't compromise security for other PHP scripts, or cause excessive clutter in the RAM due to infrequent Garbage Collection.

悸初 2024-10-12 19:26:14
  1. 编辑 phpMyAdmin 的 config.inc.php 并添加或更新 LoginCookieValidity 值,如下所示:

    $cfg['LoginCookieValidity'] = 3600 * 9; // 9 小时
    
  2. 要上传超过 2M: p>

    cd /etc/php5/apache2/php.ini
    
    sudo nano php.ini
    
  3. php.ini中搜索upload_max_filesize,并将值更改为64M(对于 64 Mb):

    upload_max_filesize = 64M
    
  4. 保存并退出。

  5. 重新启动apache

    sudo /etc/init.d/apache2 restart
    
  6. 完成!

  1. Edit phpMyAdmin's config.inc.php and add or update LoginCookieValidity the value as follows:

    $cfg['LoginCookieValidity'] = 3600 * 9; // 9 hours
    
  2. To upload more than 2M:

    cd /etc/php5/apache2/php.ini
    
    sudo nano php.ini
    
  3. Search for upload_max_filesize in php.ini, and change value to 64M (for 64 Mb):

    upload_max_filesize = 64M
    
  4. Save and exit.

  5. Restart apache:

    sudo /etc/init.d/apache2 restart
    
  6. Finish!

何止钟意 2024-10-12 19:26:14

对于第一个问题,您需要更改 config.inc.php 中的 $cfg['LoginCookieValidity'] 配置。
打开 phpMyAdmin“根”目录中的 config.inc.php。查找包含以下内容的行:$cfg['LoginCookieValidity']。将值设置为所需的秒数。如果该行不存在,只需按如下方式添加:

$cfg[‘LoginCookieValidity’] = 3600; //(3600 = one hour)

您将需要再次登录 phpmyadmin。

这还假设 PHP 会话垃圾收集已相应设置。这可以通过多种方式完成:

  • php.ini;添加包含 session.gc_maxlifetime =
  • Apache 配置的行(或更改现有行);在相应的块中添加一行内容:php_admin_value session.gc_maxlifetime
  • config.inc.php (phpMyAdmin);在之前编辑的行之后,添加一行 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:

$cfg[‘LoginCookieValidity’] = 3600; //(3600 = one hour)

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:

  • php.ini; add a line (or change an existing) that contains session.gc_maxlifetime = <seconds>
  • Apache configuration; add a line to the appropriate block that says php_admin_value session.gc_maxlifetime <seconds>
  • config.inc.php (phpMyAdmin); after the previously edited line, add a line with ini_set(‘session.gc_maxlifetime’, <seconds>);

About the second question:

You need to change both, upload_max_filesize and post_max_size in your php.ini.
The post_max_size value needs to be at least the upload_max_filesize value.

Don't forget to restart your server

Reference

甜味超标? 2024-10-12 19:26:14

尝试更改 /etc/php.ini 文件中的 post_max_size

Try by changing post_max_size in /etc/php.ini file.

自由如风 2024-10-12 19:26:14

如果您希望防止 phpMyAdmin 经常超时,您可能
添加这一行:

$cfg['LoginCookieValidity'] = 86400;

默认情况下,phpMyAdmin 每 1440 秒超时一次;要改变这一点,
更改 php.ini 中的 session.gc_maxlifetime 如下:

session.gc_maxlifetime = 86400

https://wiki.phpmyadmin。净/pma/phpMyAdmin_configuration_file

If you wished to keep phpMyAdmin from timing out so often, you might
add this line:

$cfg['LoginCookieValidity'] = 86400;

By default, phpMyAdmin times out every 1440 seconds; to change this,
change the session.gc_maxlifetime in php.ini as follows:

session.gc_maxlifetime = 86400

https://wiki.phpmyadmin.net/pma/phpMyAdmin_configuration_file

罗罗贝儿 2024-10-12 19:26:14

我知道这篇文章已经得到解答,但我刚刚解决了同样的问题,所以我想我会添加我的发现来帮助其他人。

我需要将 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.

轻拂→两袖风尘 2024-10-12 19:26:14

编辑 phpMyAdmin 的 config.inc.php 并添加或更新 LoginCookieValidity 值,如下所示:

$cfg['LoginCookieValidity'] = 3600 * 9; // 9 hours

在 wamp 或 xampp 或您在 php.ini 中使用的任何内容中,
搜索upload_max_filesize这是您应该更改的地方,

我们建议您不要使用超过64M的文件大小,因为有时会导致崩溃:

upload_max_filesize = 64M

保存并退出。

Edit phpMyAdmin's config.inc.php and add or update LoginCookieValidity the value as follows:

$cfg['LoginCookieValidity'] = 3600 * 9; // 9 hours

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:

upload_max_filesize = 64M

Save and exit.

落墨 2024-10-12 19:26:14

我在 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 if max_upload_size is also defined it will get the min of the two.

(PMA version 3.3.7deb7)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文