How to Setup phpMyAdmin on CentOS 6.3 using EPEL Repository

Share this Article :

phpmyadminThis post will covers the steps to install phpMyAdmin to operate MySQL from Web browser. phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web. It can manage a whole MySQL server (needs a super-user) as well as a single database. phpMyAdmin supports a wide range of operations with MySQL. The most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, etc), while you still have the ability to directly execute any SQL statement.

Prerequisites :

How to Configure EPEL Repository on CentOS 6.3
How to Install Httpd on CentOS 6.3
How to Install and Securing MySQL Database Server on CentOS 6.3

1. Install phpmyadmin :

[[email protected] ~]# yum --enablerepo=epel install phpMyAdmin php-mysql php-mcrypt -y

Examples :

[[email protected] ~]# yum --enablerepo=epel install phpMyAdmin php-mysql php-mcrypt -y
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: mirror.issp.co.th
 * epel: mirror.nus.edu.sg
 * extras: mirror.issp.co.th
 * updates: mirror.issp.co.th
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.i686 0:5.3.3-1.el6 will be installed
--> Processing Dependency: php-api = 20090626 for package: php-mcrypt-5.3.3-1.el6.i686
--> Processing Dependency: libmcrypt.so.4 for package: php-mcrypt-5.3.3-1.el6.i686
---> Package php-mysql.i686 0:5.3.3-14.el6_3 will be installed
--> Processing Dependency: php-pdo for package: php-mysql-5.3.3-14.el6_3.i686
---> Package phpMyAdmin.noarch 0:3.5.1-1.el6 will be installed
--> Processing Dependency: php-mbstring >= 5.2.0 for package: phpMyAdmin-3.5.1-1.el6.noarch
--> Processing Dependency: php-gd >= 5.2.0 for package: phpMyAdmin-3.5.1-1.el6.noarch
--> Processing Dependency: php >= 5.2.0 for package: phpMyAdmin-3.5.1-1.el6.noarch
--> Processing Dependency: php-php-gettext for package: phpMyAdmin-3.5.1-1.el6.noarch
--> Running transaction check
---> Package libmcrypt.i686 0:2.5.8-9.el6 will be installed
---> Package php.i686 0:5.3.3-14.el6_3 will be installed
--> Processing Dependency: php-cli = 5.3.3-14.el6_3 for package: php-5.3.3-14.el6_3.i686
---> Package php-common.i686 0:5.3.3-14.el6_3 will be installed
---> Package php-gd.i686 0:5.3.3-14.el6_3 will be installed
--> Processing Dependency: libpng12.so.0(PNG12_0) for package: php-gd-5.3.3-14.el6_3.i686
--> Processing Dependency: libpng12.so.0 for package: php-gd-5.3.3-14.el6_3.i686
--> Processing Dependency: libjpeg.so.62 for package: php-gd-5.3.3-14.el6_3.i686
--> Processing Dependency: libfreetype.so.6 for package: php-gd-5.3.3-14.el6_3.i686
--> Processing Dependency: libXpm.so.4 for package: php-gd-5.3.3-14.el6_3.i686
--> Processing Dependency: libX11.so.6 for package: php-gd-5.3.3-14.el6_3.i686
---> Package php-mbstring.i686 0:5.3.3-14.el6_3 will be installed
---> Package php-pdo.i686 0:5.3.3-14.el6_3 will be installed
---> Package php-php-gettext.noarch 0:1.0.11-3.el6 will be installed
--> Running transaction check
---> Package freetype.i686 0:2.3.11-6.el6_2.9 will be installed
---> Package libX11.i686 0:1.3-2.el6 will be installed
--> Processing Dependency: libX11-common = 1.3-2.el6 for package: libX11-1.3-2.el6.i686
--> Processing Dependency: libxcb.so.1 for package: libX11-1.3-2.el6.i686
---> Package libXpm.i686 0:3.5.8-2.el6 will be installed
---> Package libjpeg.i686 0:6b-46.el6 will be installed
---> Package libpng.i686 2:1.2.49-1.el6_2 will be installed
---> Package php-cli.i686 0:5.3.3-14.el6_3 will be installed
--> Running transaction check
---> Package libX11-common.noarch 0:1.3-2.el6 will be installed
---> Package libxcb.i686 0:1.5-1.el6 will be installed
--> Processing Dependency: libXau.so.6 for package: libxcb-1.5-1.el6.i686
--> Running transaction check
---> Package libXau.i686 0:1.0.5-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                 Arch           Version                  Repository                    Size
====================================================================================================
Installing:
 php-mcrypt              i686           5.3.3-1.el6              epel                          18 k
 php-mysql               i686           5.3.3-14.el6_3           updates                       77 k
 phpMyAdmin              noarch         3.5.1-1.el6              epel                         4.2 M
Installing for dependencies:
 freetype                i686           2.3.11-6.el6_2.9         CentOS6.3-Repository         363 k
 libX11                  i686           1.3-2.el6                CentOS6.3-Repository         585 k
 libX11-common           noarch         1.3-2.el6                CentOS6.3-Repository         188 k
 libXau                  i686           1.0.5-1.el6              CentOS6.3-Repository          22 k
 libXpm                  i686           3.5.8-2.el6              CentOS6.3-Repository          58 k
 libjpeg                 i686           6b-46.el6                CentOS6.3-Repository         133 k
 libmcrypt               i686           2.5.8-9.el6              epel                          94 k
 libpng                  i686           2:1.2.49-1.el6_2         CentOS6.3-Repository         184 k
 libxcb                  i686           1.5-1.el6                CentOS6.3-Repository         104 k
 php                     i686           5.3.3-14.el6_3           updates                      1.1 M
 php-cli                 i686           5.3.3-14.el6_3           updates                      2.2 M
 php-common              i686           5.3.3-14.el6_3           updates                      523 k
 php-gd                  i686           5.3.3-14.el6_3           updates                      103 k
 php-mbstring            i686           5.3.3-14.el6_3           updates                      453 k
 php-pdo                 i686           5.3.3-14.el6_3           updates                       72 k
 php-php-gettext         noarch         1.0.11-3.el6             epel                          21 k

Transaction Summary
====================================================================================================
Install      19 Package(s)

Total download size: 10 M
Installed size: 38 M
Downloading Packages:
Setting up and reading Presto delta metadata
updates/prestodelta                                                          |  72 kB     00:00
Processing delta metadata
Package(s) data still to download: 10 M
(1/19): libmcrypt-2.5.8-9.el6.i686.rpm                                       |  94 kB     00:00
(2/19): php-5.3.3-14.el6_3.i686.rpm                                          | 1.1 MB     00:09
(3/19): php-cli-5.3.3-14.el6_3.i686.rpm                                      | 2.2 MB     00:19
(4/19): php-common-5.3.3-14.el6_3.i686.rpm                                   | 523 kB     00:04
(5/19): php-gd-5.3.3-14.el6_3.i686.rpm                                       | 103 kB     00:00
(6/19): php-mbstring-5.3.3-14.el6_3.i686.rpm                                 | 453 kB     00:04
(7/19): php-mcrypt-5.3.3-1.el6.i686.rpm                                      |  18 kB     00:00
(8/19): php-mysql-5.3.3-14.el6_3.i686.rpm                                    |  77 kB     00:00
(9/19): php-pdo-5.3.3-14.el6_3.i686.rpm                                      |  72 kB     00:00
(10/19): php-php-gettext-1.0.11-3.el6.noarch.rpm                             |  21 kB     00:00
(11/19): phpMyAdmin-3.5.1-1.el6.noarch.rpm                                   | 4.2 MB     00:36
----------------------------------------------------------------------------------------------------
Total                                                               135 kB/s |  10 MB     01:19
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-common-5.3.3-14.el6_3.i686                                                  1/19
  Installing : libX11-common-1.3-2.el6.noarch                                                  2/19
  Installing : php-mbstring-5.3.3-14.el6_3.i686                                                3/19
  Installing : php-php-gettext-1.0.11-3.el6.noarch                                             4/19
  Installing : php-cli-5.3.3-14.el6_3.i686                                                     5/19
  Installing : php-5.3.3-14.el6_3.i686                                                         6/19
  Installing : php-pdo-5.3.3-14.el6_3.i686                                                     7/19
  Installing : php-mysql-5.3.3-14.el6_3.i686                                                   8/19
  Installing : libmcrypt-2.5.8-9.el6.i686                                                      9/19
  Installing : php-mcrypt-5.3.3-1.el6.i686                                                    10/19
  Installing : libjpeg-6b-46.el6.i686                                                         11/19
  Installing : 2:libpng-1.2.49-1.el6_2.i686                                                   12/19
  Installing : libXau-1.0.5-1.el6.i686                                                        13/19
  Installing : libxcb-1.5-1.el6.i686                                                          14/19
  Installing : libX11-1.3-2.el6.i686                                                          15/19
  Installing : libXpm-3.5.8-2.el6.i686                                                        16/19
  Installing : freetype-2.3.11-6.el6_2.9.i686                                                 17/19
  Installing : php-gd-5.3.3-14.el6_3.i686                                                     18/19
  Installing : phpMyAdmin-3.5.1-1.el6.noarch                                                  19/19
  Verifying  : freetype-2.3.11-6.el6_2.9.i686                                                  1/19
  Verifying  : php-5.3.3-14.el6_3.i686                                                         2/19
  Verifying  : php-cli-5.3.3-14.el6_3.i686                                                     3/19
  Verifying  : libXau-1.0.5-1.el6.i686                                                         4/19
  Verifying  : php-common-5.3.3-14.el6_3.i686                                                  5/19
  Verifying  : php-mbstring-5.3.3-14.el6_3.i686                                                6/19
  Verifying  : libXpm-3.5.8-2.el6.i686                                                         7/19
  Verifying  : 2:libpng-1.2.49-1.el6_2.i686                                                    8/19
  Verifying  : libxcb-1.5-1.el6.i686                                                           9/19
  Verifying  : phpMyAdmin-3.5.1-1.el6.noarch                                                  10/19
  Verifying  : libX11-1.3-2.el6.i686                                                          11/19
  Verifying  : php-php-gettext-1.0.11-3.el6.noarch                                            12/19
  Verifying  : php-gd-5.3.3-14.el6_3.i686                                                     13/19
  Verifying  : libjpeg-6b-46.el6.i686                                                         14/19
  Verifying  : libX11-common-1.3-2.el6.noarch                                                 15/19
  Verifying  : php-mysql-5.3.3-14.el6_3.i686                                                  16/19
  Verifying  : php-pdo-5.3.3-14.el6_3.i686                                                    17/19
  Verifying  : php-mcrypt-5.3.3-1.el6.i686                                                    18/19
  Verifying  : libmcrypt-2.5.8-9.el6.i686                                                     19/19

Installed:
  php-mcrypt.i686 0:5.3.3-1.el6  php-mysql.i686 0:5.3.3-14.el6_3  phpMyAdmin.noarch 0:3.5.1-1.el6

Dependency Installed:
  freetype.i686 0:2.3.11-6.el6_2.9               libX11.i686 0:1.3-2.el6
  libX11-common.noarch 0:1.3-2.el6               libXau.i686 0:1.0.5-1.el6
  libXpm.i686 0:3.5.8-2.el6                      libjpeg.i686 0:6b-46.el6
  libmcrypt.i686 0:2.5.8-9.el6                   libpng.i686 2:1.2.49-1.el6_2
  libxcb.i686 0:1.5-1.el6                        php.i686 0:5.3.3-14.el6_3
  php-cli.i686 0:5.3.3-14.el6_3                  php-common.i686 0:5.3.3-14.el6_3
  php-gd.i686 0:5.3.3-14.el6_3                   php-mbstring.i686 0:5.3.3-14.el6_3
  php-pdo.i686 0:5.3.3-14.el6_3                  php-php-gettext.noarch 0:1.0.11-3.el6

Complete!

2. on Line 14 or 15, add IP address you permit. In this case i have added 192.168.1.0/24 and i’m using apache 2.2 :

[[email protected] ~]# 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
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1 192.168.1.0/24
     Allow from ::1
   </IfModule>
</Directory>

3. Reload or restart apache httpd :

[[email protected] ~]# /etc/rc.d/init.d/httpd reload
Reloading httpd:

One Response

  1. Francois

Leave a Reply