How to Install phpMyAdmin on centos 7 Server

In this tutorial we are going to learn how to install phpMyAdmin on CentOS 7. phpMyAdmin is the most popular GUI use to manage MySQL Database. If you are running a MySQL server on CentOS 7 Linux, Then definitely you need to install phpMyAdmin in CentOS Server.

How to Install phpMyAdmin on centos 7 Server

phpMyAdmin is a web based application written in using PHP language, So before we install phpMyAdmin, we need to install PHP on CentOS 7 as well as Apache Web Server.  So let's see how it is done.

Step One

Install Apache Web Server

Install Apache httpd server on CentOS 7 using yum command.

yum install httpd

Next start the apache server and set apache server to start at the system restart.

systemctl start httpd

systemctl enable httpd

Also add a firewall rule to allow httpd port 80 from outside. This is important if you need access phpMyAdmin from a remote location.

firewall-cmd --permanent --add-service=http

firewall-cmd --permanent --add-service=https

firewall-cmd --reload

Step Two

Install PHP on CentOS 7

yum install php

systemctl restart httpd

Step Three

Add epel Repository for CentOS 7

phpMyAdmin for CentOS 7 provides by the epel software repository, so we need to enable epel repository before we Install phpMyAdmin.

yum install epel-release

Step Four

Install phpMyAdmin using yum command

Once we enabled epel, we can install phpMyAdmin on CentOS 7 using yum command.

yum install phpmyadmin

  yum install phpmyadmin centos 7

After the installation is finished, we need to restart the Apache server.

systemctl restart httpd

Now you can access phpMyAdmin from the local machine by typing http://localhost/phpmyadmin on the web browser.

Access phpMyAdmin from a Remote Computer

Default phpMyAdmin configuration do not allow remote access. So if we want to allow remote access we need to modify the configuration file.

CentOS 7 phpMyAdmin configuration file phpMyAdmin.conf is located inside the /etc/httpd/conf.d directory.  Open the configuration file with a text editor. For this You can use vim command line editor for this.

vim /etc/httpd/conf.d/phpMyAdmin.conf

To allow access from all  All IP address, append the new line Require all granted, inside <RequireAny> section under the <Directory /usr/share/phpMyAdmin/> block as below screenshot shows.

phpMyAdmin Allow All IP

Then save the configuration file and restart the Apache server once again.

systemctl restart httpd

It is better to allow only the trusted IP address by using Require ip field Rather than allowing phpMyAdmin for all IP address.

Allow phpMyAdmin remote Access

Once you allowed the remote access, you should be able to access the phpMyAdmin from a remote computer using server the ip address (Need to allow http service from the firewalld as I shown earlier). For example, if your CentOS 7 IP address is 192.168.1.100, then you from the web browser you should type.

http://192.168.1.100/phpmyadmin

So that is brings to end of this tutorial How to Install phpMyAdmin in CentOS 7 Linux.