Install phpmyAdmin host on Amazon EC2

Here we are  performing phpMyAdmin  host  on  Amzaon EC2 instance 

, it is very simple like the other Linux box configuration .We can install and configure phpMyAdmin through download  package and install it or install through yum global repositories. Here i have used remi  repository for installing phpmyadmin package.If you want to install  Remi,  repository  on your CentOS / RHEL / Fedora Box , you can check our article  Configure Additional YUM Repositories for CentOs , Red Hat and Fedora

Here I am following  install through  yum repository.

  1. Install phpMyAdmin rpm package through yum command by enabling remi repositories .


Steps to install phpmyadmin  which I have followed 


# yum --enablerepo=remi install phpMyAdmin

 Dependencies Resolved

 Package Arch Version Repository
 phpMyAdmin noarch 4.7.0-1.el7.remi remi 5.0 M
Installing for dependencies:
 dejavu-fonts-common noarch 2.33-6.el7 base 64 k
 dejavu-sans-fonts noarch 2.33-6.el7 base 1.4 M
 libtidy x86_64 0.99.0-31.20091203.el7 epel 132 k
 php-fedora-autoloader noarch 1.0.0-0.2.rc1.el7.remi remi 8.8 k
 php-google-recaptcha noarch 1.1.3-1.el7.remi remi 13 k
 php-phpmyadmin-motranslator noarch 3.0-1.el7.remi remi 19 k
 php-phpmyadmin-shapefile noarch 2.0-1.el7.remi remi 20 k
 php-phpmyadmin-sql-parser noarch 4.1.2-1.el7.remi remi 142 k
 php-phpseclib noarch 2.0.4-1.el7.remi remi 203 k
 php-symfony-class-loader noarch 2.8.18-1.el7.remi remi 25 k
 php-symfony-common noarch 2.8.18-1.el7.remi remi 130 k
 php-symfony-expression-language noarch 2.8.18-1.el7.remi remi 27 k
 php-tcpdf noarch 6.2.13-1.el7.remi remi 2.1 M
 php-tcpdf-dejavu-sans-fonts noarch 6.2.13-1.el7.remi remi 257 k
 php56w-mbstring x86_64 5.6.30-1.w7 webtatic 545 k
 php56w-process x86_64 5.6.30-1.w7 webtatic 45 k
 php56w-recode x86_64 5.6.30-1.w7 webtatic 14 k
 php56w-tidy x86_64 5.6.30-1.w7 webtatic 34 k
 recode x86_64 3.6-38.el7 base 718 k

Transaction Summary
Install 1 Package (+19 Dependent packages)

Total download size: 11 M
Installed size: 49 M
Is this ok [y/d/N]: y

2. Now navigate to the configuration file “/etc/httpd/conf.d/phpMyAdmin.conf” and allow to open phpmyadmin to access outside the local environment. Do the entry like below to phpMyadmin allow to outside your local system.

Comment the line of IP , which have loop back address and insert your IP with required parameter like below .

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

 <IfModule mod_authz_core.c> 
 # Apache 2.4 
 Require local 
 <IfModule !mod_authz_core.c>
 # Apache 2.2 
 Order Deny,Allow 
 Deny from All 
# Replace here with your IP or Network.I have replace with 
 Allow from 
 Allow from ::1 

(3) For MySQL configuration in phpMyAdmin
We have a RDS instance for Database , So we need to modify mysql host in file , which will in /usr/share/phpmyadmin folder , if it will not available with that name , might be it will named as then we need to create file and copy of content of sample file into it.

   vim /etc/phpMyAdmin/  


$cfg['Servers'][$i]['host'] = 'localhost';


$cfg['Servers'][$i]['host'] = ''; //Your-RDS-Instance-Endpoint

4. Now restart your Apache web server .

For CentOs / RHEL 5,6  :

 # service httpd restart

For CentOs / RHEL 7  :

 #  systemctl  restart  httpd.service

5. Now access your phpMyAdmin through elastic IP of your Amazon EC2 instance like below.



You can read more article to install and secure phpmyadmin on below links.

Secure your phpMyAdmin Configuration and install latest version

Install and Configure phpMyAdmin without YUM


That’s it! at this moment ..

About Sachin Gupta

I am a professional freelance contributor and founder of tech transit. Love to write and lover of education, culture, and community. I have been using it, setting, supporting, and maintaining it since 2009.Linux rocks!