phpMyAdmin configuration

2019-03-09 12:27发布

  • 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.

10条回答
戒情不戒烟
2楼-- · 2019-03-09 12:40

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

查看更多
祖国的老花朵
3楼-- · 2019-03-09 12:43

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

查看更多
淡お忘
4楼-- · 2019-03-09 12:47
  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!

查看更多
我想做一个坏孩纸
5楼-- · 2019-03-09 12:50

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.

查看更多
Viruses.
6楼-- · 2019-03-09 12:51

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

查看更多
不美不萌又怎样
7楼-- · 2019-03-09 12:57

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.

查看更多
登录 后发表回答