The Problem
I have just installed LAMP on my CentOS machine and while trying to access phpMyadmin thorugh cPanel, get below error:
Existing configuration file (./config.inc.php) is not readable.
The Solution
The above error is due to the misconfiguration of permissions of the phpMyAdmin configuration file – /usr/local/cpanel/base/3rdparty/phpMyAdmin.
Follow the steps outlined below in order to resolve the issue:
1. Login to the server with root user.
2. View current the permissions of the configuration file “/usr/local/cpanel/base/3rdparty/phpMyAdmin”:
# ls -lrt /usr/local/cpanel/base/3rdparty/phpMyAdmin -rw-r----- 1 root cpanelphpmyadmin 2409 June 21 2019 config.inc.php
3. Make sure the ownership of the configuration file is “root:cpanelphpmyadmin“. If not change it to “root:cpanelphpmyadmin”:
# chown root:cpanelphpmyadmin /usr/local/cpanel/base/3rdparty/phpMyAdmin
4. Also make sure that the permission of the confioguration file is 640. If not, change it to 640 using:
# chmod 640 /usr/local/cpanel/base/3rdparty/phpMyAdmin
5. Verify both the ownership and permissions and it should be as shown below:
# ls -lrt /usr/local/cpanel/base/3rdparty/phpMyAdmin -rw-r----- 1 root cpanelphpmyadmin 2409 June 21 2019 config.inc.php
6. Restart the cpanel and mysql service on the server for the changes to take effect:
# /etc/init.d/cpanel restart
# /etc/init.d/mysql restart