Install phpMyAdmin in CentOS 7

Reading Time: 2 minutes

Today, let us install phpMyAdmin in our CentOS 7 Virtual Machine, if you have not read the complete installation for LAMP Stack, see the article below:

Install LAMP stack on your CentOS 7

What is phpMyAdmin?

is a web interface through which you can manage your MySQL databases.

By default, the official CentOS 7.0 repositories don’t provide any binary package for phpMyAdmin Web Interface.

If you are uncomfortable using MySQL command line to manage your database you can install phpMyAdmin package by enabling CentOS 7.0 rpmforge repositories using the following command.

yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

Let us proceed with our phpMyAdmin installation using the command below:

yum -y install phpMyAdmin
image-67 Install phpMyAdmin in CentOS 7

Once completed we need to change the Apache configuration so that phpMyAdmin allows connections not just from localhost. To do so, comment the line shown below inside the :

nano /etc/httpd/conf.d/phpMyAdmin.conf
<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
#     <RequireAny>
#       Require ip 127.0.0.1
#       Require ip ::1
#     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

Then add the line Require all granted as shown below:

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
#     <RequireAny>
#       Require ip 127.0.0.1
#       Require ip ::1
#     </RequireAny>

Require all granted
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>
image-68 Install phpMyAdmin in CentOS 7

Make sure to restart Apache service by running the command below:

systemctl restart httpd

From here, you can now access your phpMyAdmin using:

http://ip_address/phpmyadmin/
image-69 Install phpMyAdmin in CentOS 7

Just use your root as your username and the password you set during the MariaDB installation guide.

image-70 Install phpMyAdmin in CentOS 7

At this point, you have successfully installed phpMyAdmin on your CentOS 7.

Great Job.

Was this post helpful?

Leave a Reply