Skip to main content

How to install phpmyadmin on nginx on centos 6

Phpmyadmin is a free tool used to administrate MySQL . it supports all major operation with MySQL in GUI mode.
In the previous post we saw about installing and configuring nginx on centos 6.5 . Here we can see about installing phpmyadmin on nginx server.
Before starting please make sure you have installed LEMP stack ( Nginx , mysql and php )
Refer this post (Install LEMP on centos 6)

Install phpmyadmin on nginx on centos 6.5

Step 1 » Enable EPEL repository for installing dependencies . Find the latest release file from EPEL 6 repository and install using rpm command.
[root@krizna ~]# rpm -ivh
Step 2 » Install dependencies by the below command.
[root@krizna ~]# yum install php php-cli php-gd php-mbstring php-mcrypt php-php-gettext apr-util-ldap mailcap
Step 3 » Download latest phpmyadmin from official site ( Phpmyadmin Download ) to /usr/share/ directory. choose .tar.bz2 for less size and easy extraction with default tar command.
[root@krizna ~]# cd /usr/share/
[root@krizna share]# wget

Step 4 » Extract the files using the below command.
[root@krizna share]# tar -xvf phpMyAdmin-4.1.7-all-languages.tar.bz2
Step 5 » Rename the folder .
[root@krizna share]# mv phpMyAdmin-4.1.7-all-languages phpmyadmin
Step 6 » Create a config file inside phpmyadmin folder. just copy into file .
[root@krizna phpmyadmin]# cp
Step 7 » Create a virtual site to access phpmyadmin in 8080 port . Create a file /etc/nginx/conf.d/phpmyadmin.conf and add the below lines .

Step 8 » Restart nginx service.
[root@krizna ~]# service nginx restart
Open /etc/sysconfig/iptables file and add the following line to open port 8080 in iptables.
-A INPUT -m state --state NEW -p tcp --dport 8080 -j ACCEPT
Step 9 » Now open http://serverip:8080 in your browser . you could see phpmyadmin login page . use mysql root username and password to login . after logged in, you can see the page below.
All the best.