In this post, i will show on how to install phpMyAdmin on CentOS 5.8 using EPEL repository. phpMyAdmin is a opensource tool written in PHP intended to handle the MySQL administration using web interface over the internet. It can manage a whole MySQL server as well as a single database. This post assumed that MySQL and Apache Httpd server has been installed and configured properly.
1. How to Install and Configure EPEL Repository :
Follow this steps to install and configure the Extra Packages for Enterprise Linux (EPEL) repository on CentOS 5.8. EPEL repository is another extra repository that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL) and CentOS server.
2. Simply run the following command to install phpmyadmin :
[root@centos58 ~]# yum install phpmyadmin -y
Example :
[root@centos58 ~]# yum install phpmyadmin -y Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.ipserverone.com * epel: mirror.nus.edu.sg * extras: centos.ipserverone.com * updates: mirrors.hostemo.com Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package phpMyAdmin.noarch 0:2.11.11.3-2.el5 set to be updated --> Processing Dependency: php-mcrypt >= 4.1.0 for package: phpMyAdmin --> Processing Dependency: php-gd >= 4.1.0 for package: phpMyAdmin --> Processing Dependency: php-mysql >= 4.1.0 for package: phpMyAdmin --> Processing Dependency: php >= 4.1.0 for package: phpMyAdmin --> Processing Dependency: php-mbstring >= 4.1.0 for package: phpMyAdmin --> Running transaction check ---> Package php.i386 0:5.1.6-34.el5_8 set to be updated --> Processing Dependency: php-common = 5.1.6-34.el5_8 for package: php --> Processing Dependency: php-cli = 5.1.6-34.el5_8 for package: php --> Processing Dependency: libcurl.so.3 for package: php --> Processing Dependency: libgmp.so.3 for package: php --> Processing Dependency: libidn.so.11 for package: php --> Processing Dependency: libaspell.so.15 for package: php --> Processing Dependency: libpspell.so.15 for package: php ---> Package php-gd.i386 0:5.1.6-34.el5_8 set to be updated ---> Package php-mbstring.i386 0:5.1.6-34.el5_8 set to be updated ---> Package php-mcrypt.i386 0:5.1.6-15.el5.centos.1 set to be updated --> Processing Dependency: libmcrypt.so.4 for package: php-mcrypt ---> Package php-mysql.i386 0:5.1.6-34.el5_8 set to be updated --> Processing Dependency: php-pdo for package: php-mysql --> Running transaction check ---> Package aspell.i386 12:0.60.3-12 set to be updated --> Processing Dependency: aspell-en for package: aspell ---> Package curl.i386 0:7.15.5-15.el5 set to be updated ---> Package gmp.i386 0:4.1.4-10.el5 set to be updated ---> Package libidn.i386 0:0.6.5-1.1 set to be updated ---> Package libmcrypt.i386 0:2.5.8-4.el5.centos set to be updated ---> Package php-cli.i386 0:5.1.6-34.el5_8 set to be updated ---> Package php-common.i386 0:5.1.6-34.el5_8 set to be updated ---> Package php-pdo.i386 0:5.1.6-34.el5_8 set to be updated --> Running transaction check ---> Package aspell-en.i386 50:6.0-2.1 set to be updated --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================== Package Arch Version Repository Size ==================================================================================================== Installing: phpMyAdmin noarch 2.11.11.3-2.el5 epel 4.2 M Installing for dependencies: aspell i386 12:0.60.3-12 base 946 k aspell-en i386 50:6.0-2.1 base 1.6 M curl i386 7.15.5-15.el5 base 235 k gmp i386 4.1.4-10.el5 base 664 k libidn i386 0.6.5-1.1 base 194 k libmcrypt i386 2.5.8-4.el5.centos extras 116 k php i386 5.1.6-34.el5_8 updates 2.3 M php-cli i386 5.1.6-34.el5_8 updates 2.1 M php-common i386 5.1.6-34.el5_8 updates 154 k php-gd i386 5.1.6-34.el5_8 updates 118 k php-mbstring i386 5.1.6-34.el5_8 updates 996 k php-mcrypt i386 5.1.6-15.el5.centos.1 extras 16 k php-mysql i386 5.1.6-34.el5_8 updates 87 k php-pdo i386 5.1.6-34.el5_8 updates 66 k Transaction Summary ==================================================================================================== Install 15 Package(s) Upgrade 0 Package(s) Total download size: 14 M Downloading Packages: (1/15): php-mcrypt-5.1.6-15.el5.centos.1.i386.rpm | 16 kB 00:00 (2/15): php-pdo-5.1.6-34.el5_8.i386.rpm | 66 kB 00:00 (3/15): php-mysql-5.1.6-34.el5_8.i386.rpm | 87 kB 00:00 (4/15): libmcrypt-2.5.8-4.el5.centos.i386.rpm | 116 kB 00:00 (5/15): php-gd-5.1.6-34.el5_8.i386.rpm | 118 kB 00:00 (6/15): php-common-5.1.6-34.el5_8.i386.rpm | 154 kB 00:01 (7/15): libidn-0.6.5-1.1.i386.rpm | 194 kB 00:01 (8/15): curl-7.15.5-15.el5.i386.rpm | 235 kB 00:01 (9/15): gmp-4.1.4-10.el5.i386.rpm | 664 kB 00:05 (10/15): aspell-0.60.3-12.i386.rpm | 946 kB 00:08 (11/15): php-mbstring-5.1.6-34.el5_8.i386.rpm | 996 kB 00:08 (12/15): aspell-en-6.0-2.1.i386.rpm | 1.6 MB 00:13 (13/15): php-cli-5.1.6-34.el5_8.i386.rpm | 2.1 MB 00:18 (14/15): php-5.1.6-34.el5_8.i386.rpm | 2.3 MB 00:26 (15/15): phpMyAdmin-2.11.11.3-2.el5.noarch.rpm | 4.2 MB 00:37 ---------------------------------------------------------------------------------------------------- Total 108 kB/s | 14 MB 02:09 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : php-common 1/15 Installing : libidn 2/15 Installing : curl 3/15 Installing : gmp 4/15 Installing : php-gd 5/15 Installing : php-mbstring 6/15 Installing : php-pdo 7/15 Installing : php-mysql 8/15 Installing : libmcrypt 9/15 Installing : aspell-en 10/15 Installing : aspell 11/15 Installing : php-cli 12/15 Installing : php 13/15 Installing : php-mcrypt 14/15 Installing : phpMyAdmin 15/15 Installed: phpMyAdmin.noarch 0:2.11.11.3-2.el5 Dependency Installed: aspell.i386 12:0.60.3-12 aspell-en.i386 50:6.0-2.1 curl.i386 0:7.15.5-15.el5 gmp.i386 0:4.1.4-10.el5 libidn.i386 0:0.6.5-1.1 libmcrypt.i386 0:2.5.8-4.el5.centos php.i386 0:5.1.6-34.el5_8 php-cli.i386 0:5.1.6-34.el5_8 php-common.i386 0:5.1.6-34.el5_8 php-gd.i386 0:5.1.6-34.el5_8 php-mbstring.i386 0:5.1.6-34.el5_8 php-mcrypt.i386 0:5.1.6-15.el5.centos.1 php-mysql.i386 0:5.1.6-34.el5_8 php-pdo.i386 0:5.1.6-34.el5_8 Complete!
3. Open the phpMyAdmin.conf configuration file as below :
[root@centos58 ~]# vi /etc/httpd/conf.d/phpMyAdmin.conf
Original phpMyAdmin.conf configuration file :
<Directory /usr/share/phpMyAdmin/> Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 </Directory>
Change as below. Default setting only allows only localhost. Changes below will allow access to any ip address but very dangerous unless properly secured by SSL :
<Directory /usr/share/phpMyAdmin/> Order Deny,Allow Deny from All Allow from All Allow from ::1 </Directory>
4. Restart apache httpd service :
[root@centos58 ~]# /etc/init.d/httpd restart
5. Open PhpMyAdmin from myour browser using the following URL :
http://CentOS5.8_Ipaddress/phpmyadmin/
This will install phpMyAdmin – 2.11.11.3 on your CentOS 5.8