How to Install PhpMyAdmin on CentOS/RHEL 7/6

Channel: Linux
Abstract: This will disable local restriction access and phpMyAdmin will be accessible from the network. Alias /phpMyAdmin /usr/share/phpMyAdmin Alias /phpmyadm

phpMyAdmin is a well most popular web-based client for managing MySQL server. PHPMyAdmin is written in PHP programming language. It provides a user-friendly web interface to access and manage your databases. To ease usage to a wide range of people, phpMyAdmin is being translated into 72 languages and supports both LTR and RTL languages. This article will help you to install phpMyAdmin on CentOS/RedHat System.

Prerequsities

In order to use PHPMyAdmin, you must have PHP, MySQL and Apache installed on your system. Also, you need PHP-MySQL or PHP-MySQLi module enabled in PHP configuration. For the current version of PHPMyAdmin 4.7.2, the requirements are as follows.

  • Apache >= 2.2
  • PHP >= 5.5
  • MySQL/MariaDB >= 5.5

Use the tutorial: Installing Apache MySQL PHP on CentOS and RedHat

Step 1 – Enable Remi Repository

phpMyAdmin most updated package is available in Remi repository. Install it in your system using the following commands.

### CentOS/RHEL 7 ###
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

### CentOS/RHEL 6 ###
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Step 2 – Install PhpMyAdmin on CentOS

After enabling Remi repository on your system, let’s start the with the installation of phpMyAdmin using yum package manager. All the dependencies will automatically be installed.

yum --enablerepo=remi,remi-test  install phpMyAdmin
Step 3 – Configure PhpMyAdmin

phpMyAdmin by default allowed to access from localhost only. If you want to make it accessible from remote computers edit Apache configuration file of phpMyAdmin.

sudo vi /etc/httpd/conf.d/phpMyAdmin.conf

Now check for below section. Change Require local to Require all granted, This will disable local restriction access and phpMyAdmin will be accessible from the network.

Alias /phpMyAdmin /usr/share/phpMyAdmin Alias /phpmyadmin /usr/share/phpMyAdmin <Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 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>123456789101112131415161718Alias /phpMyAdmin /usr/share/phpMyAdminAlias /phpmyadmin /usr/share/phpMyAdmin <Directory /usr/share/phpMyAdmin/>   AddDefaultCharset UTF-8    <IfModule mod_authz_core.c>     # Apache 2.4     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>

After updating phpMyAdmin Apache configuration file, restart Apache service to reload new settings.

service httpd restart
Step 4 – Access phpMyAdmin in Browser

Now you can access phpMyAdmin in a browser using the following URL. Change svr1.tecadmin.net with your server IP/FQDN.

http://svr1.tecadmin.net/phpMyAdmin/

Login Details: Use MySQL username and password.

Congratulation’s You have successfully installed phpMyAdmin. Using single phpMyAdmin we can manage multiple MySQL servers by adding multiple remote MySQL server. Use this article to add multiple MySQL hosts in phpMyAdmin.

Ref From: tecadmin

Related articles