Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
How to increase or modify the timeout limit of a login session in phpMyAdmin?
Answer
-
Plesk for Linux:
-
Connect to the server via SSH
-
Go to the file path
/usr/local/psa/phpMyAdmin/
:# cd /usr/local/psa/phpMyAdmin/
-
Create the file
config.inc.php
if it doesn't exist copying the template filelibraries/config.default.php
:# if [ ! -f config.inc.php ]; then cp -a {libraries/config.default.php,config.inc.php}; fi
-
Edit the file
config.inc.php
with a text editor:# vi config.inc.php
-
Change the value of the parameter
LoginCookieValidity
:CONFIG_TEXT: $cfg['LoginCookieValidity'] = 1800;
-
Save the changes and close the file
-
Connect to the server via SSH
-
Go to the file path
/usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/
:# cd /usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/
-
Create the file
config.inc.php
if it doesn't exist copying the template filelibraries/config.default.php
:# if [ ! -f config.inc.php ]; then cp -a {libraries/config.default.php,config.inc.php}; fi
-
Edit the file
config.inc.php
with a text editor:# vi config.inc.php
-
Change the value of the parameter
LoginCookieValidity
:CONFIG_TEXT: $cfg['LoginCookieValidity'] = 1800;
-
Save the changes and close the file
-
Plesk for Windows:
-
Connect to the server via RDP
-
Go to the following folder path:
%plesk_dir%phpmyadmin\
-
Create or edit the file
config.inc.php
with a text editor -
Add or change the value of the parameter
LoginCookieValidity
and save the changes:CONFIG_TEXT: <?php
declare(strict_types=1);
// ...
$cfg['LoginCookieValidity'] = 1800; -
Edit the Plesk PHP.ini file
%plesk_dir%admin\conf\php.ini
with a text editor -
Add or edit the parameter
session.gc_maxlifetime
in the[Session]
section with the same value configured inLoginCookieValidity
and save the changes:CONFIG_TEXT: ...
[Session]
session.gc_maxlifetime = 1800
... -
Log out from phpMyAdmin and Plesk to start a new PHP session
-
Connect to the server via RDP
-
Go to the following folder path:
%plesk_dir%admin\htdocs\domains\databases\phpMyAdmin\
-
Create or edit the file
config.inc.php
with a text editor -
Add or change the value of the parameter
LoginCookieValidity
and save the changes:CONFIG_TEXT: <?php
declare(strict_types=1);
// ...
$cfg['LoginCookieValidity'] = 1800; -
Edit the Plesk PHP.ini file
%plesk_dir%admin\conf\php.ini
with a text editor -
Add or edit the parameter
session.gc_maxlifetime
in the[Session]
section with the same value configured inLoginCookieValidity
and save the changes:CONFIG_TEXT: ...
[Session]
session.gc_maxlifetime = 1800
... -
Log out from phpMyAdmin and Plesk to start a new PHP session
Comments
13 comments
Apparently, this setting was removed from the phpMyAdmin interface in version 4.8.0 as per GitHub issue #15001. Any chance this will be added to the Plesk GUI at some point?
There is a large ASCII image at the top of config.default.php that says: NO!! DO NOT EDIT!!
It says to edit config.inc.php instead. I found the following info in the phpMyAdmin docs.
Quote from Configuration Section
"All configurable data is placed in
config.inc.php
in phpMyAdmin’s toplevel directory. If this file does not exist, please refer to the Installation section to create one. This file only needs to contain the parameters you want to change from their corresponding default value inlibraries/config.default.php
(this file is not intended for changes)."Quote from Installation Section
"To manually create the file, simply use your text editor to create the file
config.inc.php
(you can copyconfig.sample.inc.php
to get a minimal configuration file) in the main (top-level) phpMyAdmin directory (the one that containsindex.php
). phpMyAdmin first loadslibraries/config.default.php
and then overrides those values with anything found inconfig.inc.php
. If the default value is okay for a particular setting, there is no need to include it inconfig.inc.php
."@Jennifer Arsenault
You are right, the mentioned setting was removed from the phpMyAdmin interface. Since it is a phpMyAdmin setting, it will not be added to Plesk interface.
As for the config.inc.php, I have edited the article accordingly. Thank you for noticing!
@...
Hi, I followed all of the described steps, restarted the server, but unfortunately I get always the message in PMA that there was an inactivity for 1440 seconds and therefore I have to log in again. What am I doing wrong?
@Peter VARGA
Please also try to increase the session.gc_maxlifetime PHP value as well. Open Tools & Settings > PHP settings > OS PHP version > PHP.ini > find the session.gc_maxlifetime and increase its value so it is equal or higher than LoginCookieValidity.
@...
Nothing helps, the hoster company and I have tried everything.
It simple doesn't work in the Plesk environment.
Hello Peter VARGA
In that case, additional investigation is required. You may submit a support request to Plesk support or contact phpMyAdmin community here.
In general, phpMyAdmin is installed by Plesk as is, without finetuning or customizations.
@...
Ivan Postnikov
Unfortunately, all the steps described above don't work at all. Here is my summary and how I solved:
Hello Peter VARGA
Thank you for the message and for sharing the steps which helped you.
Currently, it's unclear why the solution form the article didn't help. In case our technical support will meet a similar issue and investigate the case on the affected server, the article will be updated.
It would seem the article is incorrect. If you notice in my previous comment where I quote phpMyAdmin docs, the
config.inc.php
file must be created in the main (top-level) phpMyAdmin directory (the one that containsindex.php
) and NOT in thelibraries
directory. It also suggests copying a minimal file fromconfig.sample.inc.php
rather than duplicating all the default settings.Jennifer Waterfall Hi, that you for bringing our attention to this. We updated article.
Thank you Jennifer, yes, this makes now sense. As I noted in the post above, the changes were lost with each update.
There is still this issue: The session.gc_maxlifetime settings, as described by Alisa is also not correct. I have to change them directly in /usr/local/psa/admin/conf/php.ini but each time Plesk install updates, the settings are gone.
I ask the Plesk developers kindly to provide here a solution in which php.ini file session.gc_maxlifetime has to be set permanently, and also, how to restart Apache so the changes become active.
Thank you
Hello Peter VARGA. PhpMyAdmin session should be linked to Plesk session, means to increase its lifetime instead of gc_maxlifetime use option Tools & Settings > Active Plesk Sessions > Settings to increase its lifetime.
Please sign in to leave a comment.