Install phpMyadmin Nginx CentOS 6

Prior to installing phpMyAdmin, we should verify that NGINX MySQL PHP (LEMP) has been installed and all of the LEMP services are started and running.  We can grep look for their processes – “nginx”, “mysqld” and “php-fpm”:

#ps auxf | egrep "nginx|mysqld|php-fpm"

If you see processes similar to the ones below, you may proceed with the phpMyAdmin installation, otherwise you need to get back to the LEMP setup tutorial:

[root@vpshelpdesk phpMyAdmin]# ps auxf | egrep "nginx|mysqld|php-fpm"
root 1171 0.0 0.2 2340 588 pts/0 S+ 15:01 0:00 | \_ gr ep -E nginx|mysqld|php-fpm
root 574 0.0 0.5 3044 1324 ? S 14:41 0:00 /bin/sh /usr/bin/mysqld_sa fe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/m ysqld.pid --basedir=/usr --user=mysql

Install phpMyadmin

#wget https://files.phpmyadmin.net/phpMyAdmin/4.1.7/phpMyAdmin-4.1.7-all-languages.zip
#unzip phpMyAdmin-4.1.7-all-languages.zip
#mv phpMyAdmin-4.1.7-all-languages.zip phpMyAdmin
#mv phpMyAdmin /usr/share/nginx/html
#cd /usr/share/nginx/html/phpMyAdmin
#service nginx restart
#service php-fpm restart

Check the result http://ipaddress/phpMyAdmin
phpMyadmin page will appear but this still not work, we should edit phpMyadmin config.ing.php

#cd /usr/share/nginx/html/phpMyAdmin/
#mv config.sample.inc.php config.inc.php
#vi /usr/share/nginx/html/phpMyAdmin/config.ing.php
Edit following lines:
$cfg['Servers'][$i]['auth_type'] = 'cookie';
With this:
$cfg['Servers'][$i]['auth_type'] = 'http';
#service nginx restart
#service php-fpm restart

Check the result again http://ipaddress/phpMyAdmin
It will work!

Leave a Reply

Your email address will not be published. Required fields are marked *