Thursday, May 8, 2014

How To Install PhpMyAdmin On CentOS 6

It's very easy, just follow the steps:

1. Download the epel repo :

cd /tmp
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

2. Install the epel repo :

cd /tmp
rpm -ivh epel-release-6-8.noarch.rpm

3. install phpmyadmin using yum :

yum install phpmyadmin

=======================================================

 Package               Arch         Version                 Repository     Size
=======================================================

Installing:
 phpMyAdmin            noarch       3.5.8.2-1.el6           epel          4.3 M


Installing for dependencies:
 libmcrypt             x86_64       2.5.8-9.el6             epel           96 k
 php-gd                x86_64       5.3.3-27.el6_5          updates       107 k
 php-mbstring          x86_64       5.3.3-27.el6_5          updates       455 k
 php-mcrypt            x86_64       5.3.3-3.el6             epel           19 k
 php-php-gettext       noarch       1.0.11-3.el6            epel           21 k
4. Config phpmyadmin, we change the Apache configuration so that phpMyAdmin allows connections not just from localhost (add or just replace):

vi /etc/httpd/conf.d/phpmyadmin.conf

<Directory /usr/share/phpMyAdmin/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1
       Require ip ::1
       Require ip 192.168.0.6
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
     Allow from 192.168.0.6
   </IfModule>
</Directory>
 
5. Restart httpd service.

Now test from your browser!