Random small break-fix or enlightening ideas
I use phpMyAdmin a lot for LAMP development. The default login timeout is something like 30 minutes. Here is how to increase that.
The first file we need to edit is the phpMyAdmin configuration file – config.inc.php
. The location of this file will vary depending on how this was installed. If phpMyAdmin was installed from the Ubuntu package repositories, it is located at /etc/phpmyadmin/config.inc.php
.
Edit the file:
[root]$ vim /etc/phpmyadmin/config.inc.php
Add this line to the bottom (or edit it if the config option exists):
$cfg['LoginCookieValidity'] = 172800; /* 48 hours */
Change the timeout value to whatever your preference is.
After you update this setting, go ahead and log into phpMyAdmin again. You may see this message:
phpMyAdmin uses the PHP session cookie, and this also has a timeout value. To update this, we will need to update php.ini
. Just like phpMyAdmin’s config file, the location will vary depending on your environment. If you installed PHP and Apache2 through Ubuntu’s repositories, the file in question is located at /etc/php5/apache2/php.ini
.
So for me, I can edit the file by running this:
[root]$ vim /etc/php5/apache2/php.ini
Look for the option session.gc_maxlifetime
. For me it was near line 1500. This is what I changed it to:
session.gc_maxlifetime = 172800
Keep in mind that if this value is too high on a busy server, you might start to hit memory or filesystem limits.
After saving this last file, restart Apache2:
[root]$ service apache2 restart
Now load phpMyAdmin again, and that warning should no longer appear.