How to Install phpMyAdmin on CentOS 5.7 using RPMforge Repository

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. In this post, i will show on how to install phpMyAdmin on CentOS 5.7 using RPMforge repository. This steps has been tested on CentOS 5.7, but it may working on CentOS 5.1, CentOS 5.2, CentOS 5.4, CentOS 5.5, CentOS 5.6 and RHEL 5. At the time this article wrote, the installed phpMyAdmin was phpMyAdmin version 2.11. This post assumed that third party repository RPMforge has been added, MySQL and Apache Httpd server also has been installed and configured as per guidelines below :

How to Install MySQL Database Server on CentOS 5.7
How to Install Httpd on CentOS 5.7
How to Add the RPMforge Repository on CentOS 5/RHEL 5 Linux Server

1. Simply run this command to install phpMyAdmin :

[root@CentOS57 ~]# yum install phpmyadmin -y
[root@CentOS57 ~]# yum install phpmyadmin -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.oscc.org.my
 * extras: mirror.oscc.org.my
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: mirror.oscc.org.my
base                                                                         | 1.1 kB     00:00
extras                                                                       | 2.1 kB     00:00
updates                                                                      | 1.9 kB     00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package phpmyadmin.noarch 0:2.11.11.3-2.el5.rf set to be updated
--> Processing Dependency: php-mysql >= 4.1.0 for package: phpmyadmin
--> Processing Dependency: php-mbstring >= 4.1.0 for package: phpmyadmin
--> Processing Dependency: php-mcrypt for package: phpmyadmin
--> Running transaction check
---> Package php-mbstring.i386 0:5.1.6-32.el5 set to be updated
--> Processing Dependency: php-common = 5.1.6-32.el5 for package: php-mbstring
---> Package php-mcrypt.i386 0:5.1.6-15.el5.centos.1 set to be updated
--> Processing Dependency: php >= 5.1.6 for package: php-mcrypt
--> Processing Dependency: libmcrypt.so.4 for package: php-mcrypt
---> Package php-mysql.i386 0:5.1.6-32.el5 set to be updated
--> Processing Dependency: php-pdo for package: php-mysql
--> Running transaction check
---> Package libmcrypt.i386 0:2.5.8-4.el5.centos set to be updated
---> Package php.i386 0:5.1.6-32.el5 set to be updated
--> Processing Dependency: php-cli = 5.1.6-32.el5 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-common.i386 0:5.1.6-32.el5 set to be updated
---> Package php-pdo.i386 0:5.1.6-32.el5 set to be updated
--> 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 php-cli.i386 0:5.1.6-32.el5 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.rf                rpmforge           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-32.el5                      base               2.3 M
 php-cli                i386             5.1.6-32.el5                      base               2.1 M
 php-common             i386             5.1.6-32.el5                      base               153 k
 php-mbstring           i386             5.1.6-32.el5                      base               996 k
 php-mcrypt             i386             5.1.6-15.el5.centos.1             extras              16 k
 php-mysql              i386             5.1.6-32.el5                      base                87 k
 php-pdo                i386             5.1.6-32.el5                      base                66 k

Transaction Summary
====================================================================================================
Install      14 Package(s)
Upgrade       0 Package(s)

Total download size: 14 M
Downloading Packages:
(1/14): php-mcrypt-5.1.6-15.el5.centos.1.i386.rpm                            |  16 kB     00:00
(2/14): php-pdo-5.1.6-32.el5.i386.rpm                                        |  66 kB     00:00
(3/14): php-mysql-5.1.6-32.el5.i386.rpm                                      |  87 kB     00:00
(4/14): libmcrypt-2.5.8-4.el5.centos.i386.rpm                                | 116 kB     00:01
(5/14): php-common-5.1.6-32.el5.i386.rpm                                     | 153 kB     00:01
(6/14): libidn-0.6.5-1.1.i386.rpm                                            | 194 kB     00:01
(7/14): curl-7.15.5-15.el5.i386.rpm                                          | 235 kB     00:01
(8/14): gmp-4.1.4-10.el5.i386.rpm                                            | 664 kB     00:05
(9/14): aspell-0.60.3-12.i386.rpm                                            | 946 kB     00:11
(10/14): php-mbstring-5.1.6-32.el5.i386.rpm                                  | 996 kB     00:08
(11/14): aspell-en-6.0-2.1.i386.rpm                                          | 1.6 MB     00:13
(12/14): php-cli-5.1.6-32.el5.i386.rpm                                       | 2.1 MB     00:20
(13/14): php-5.1.6-32.el5.i386.rpm                                           | 2.3 MB     00:23
(14/14): phpmyadmin-2.11.11.3-2.el5.rf.noarch.rpm                            | 4.2 MB     00:42
----------------------------------------------------------------------------------------------------
Total                                                               103 kB/s |  14 MB     02:14
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : php-common                                                                  1/14
  Installing     : libidn                                                                      2/14
  Installing     : curl                                                                        3/14
  Installing     : gmp                                                                         4/14
  Installing     : php-mbstring                                                                5/14
  Installing     : php-pdo                                                                     6/14
  Installing     : php-mysql                                                                   7/14
  Installing     : libmcrypt                                                                   8/14
  Installing     : aspell-en                                                                   9/14
  Installing     : aspell                                                                     10/14
  Installing     : php-cli                                                                    11/14
  Installing     : php                                                                        12/14
  Installing     : php-mcrypt                                                                 13/14
  Installing     : phpmyadmin                                                                 14/14

Installed:
  phpmyadmin.noarch 0:2.11.11.3-2.el5.rf

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-32.el5                            php-cli.i386 0:5.1.6-32.el5
  php-common.i386 0:5.1.6-32.el5                     php-mbstring.i386 0:5.1.6-32.el5
  php-mcrypt.i386 0:5.1.6-15.el5.centos.1            php-mysql.i386 0:5.1.6-32.el5
  php-pdo.i386 0:5.1.6-32.el5

Complete!

2. Configure phpMyAdmin to allows connections not just from localhost by change the following line :

Allow from 127.0.0.1

to

Allow from all

New Configuration should as below :

#
#  Web application to manage MySQL
#

<Directory "/usr/share/phpmyadmin">
  Order Deny,Allow
  Deny from all
  Allow from all
</Directory>

Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin

3. Change the authentication in phpMyAdmin from cookie to http :

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';

4. Reload or restart the apache server :

[root@CentOS57 ~]# service httpd reload
  •  Apache: http://httpd.apache.org/
  • References :

  • PHP: http://www.php.net/
  • MySQL: http://www.mysql.com/
  • CentOS: http://www.centos.org/
  • phpMyAdmin: http://www.phpmyadmin.net/
  • How to Install PHP on RHEL 6

    In this post, i will show on how to install PHP on Redhat Enterprise Linux 6 (RHEL 6). PHP is a powerful tool and server-side scripting language originally designed for making dynamic and interactive Web pages. It was widely-used, free, and efficient alternative for scripting language. Please follow this howto to install PHP on your RHEL 6 server. This post assumed that you have set up local yum repository using your DVDROM. If you haven’t set up the local yum repository, please proceed to this steps :
    How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on RHEL 6

    Simply run this command to install PHP on RHEL 6 :

      [root@rhel6 ~]# yum install php-* php -y
      Loaded plugins: rhnplugin
      This system is not registered with RHN.
      RHN support will be disabled.
      DVD-RHEL6-Repository                                                         | 3.7 kB     00:00 ...
      DVD-RHEL6-Repository/primary_db                                              | 2.3 MB     00:00 ...
      Setting up Install Process
      Resolving Dependencies
      --> Running transaction check
      ---> Package php.i686 0:5.3.2-6.el6 set to be updated
      ---> Package php-cli.i686 0:5.3.2-6.el6 set to be updated
      ---> Package php-common.i686 0:5.3.2-6.el6 set to be updated
      ---> Package php-gd.i686 0:5.3.2-6.el6 set to be updated
      ---> Package php-ldap.i686 0:5.3.2-6.el6 set to be updated
      ---> Package php-mysql.i686 0:5.3.2-6.el6 set to be updated
      ---> Package php-odbc.i686 0:5.3.2-6.el6 set to be updated
      ---> Package php-pdo.i686 0:5.3.2-6.el6 set to be updated
      ---> Package php-pear.noarch 1:1.9.0-2.el6 set to be updated
      ---> Package php-pecl-apc.i686 0:3.1.3p1-1.2.el6.1 set to be updated
      ---> Package php-pecl-memcache.i686 0:3.0.4-3.2.el6.2 set to be updated
      ---> Package php-pgsql.i686 0:5.3.2-6.el6 set to be updated
      ---> Package php-soap.i686 0:5.3.2-6.el6 set to be updated
      ---> Package php-xml.i686 0:5.3.2-6.el6 set to be updated
      ---> Package php-xmlrpc.i686 0:5.3.2-6.el6 set to be updated
      --> Finished Dependency Resolution
      
      Dependencies Resolved
      
      ====================================================================================================
       Package                  Arch          Version                   Repository                   Size
      ====================================================================================================
      Installing:
       php                      i686          5.3.2-6.el6               DVD-RHEL6-Repository        1.1 M
       php-cli                  i686          5.3.2-6.el6               DVD-RHEL6-Repository        2.2 M
       php-common               i686          5.3.2-6.el6               DVD-RHEL6-Repository        516 k
       php-gd                   i686          5.3.2-6.el6               DVD-RHEL6-Repository        101 k
       php-ldap                 i686          5.3.2-6.el6               DVD-RHEL6-Repository         34 k
       php-mysql                i686          5.3.2-6.el6               DVD-RHEL6-Repository         73 k
       php-odbc                 i686          5.3.2-6.el6               DVD-RHEL6-Repository         46 k
       php-pdo                  i686          5.3.2-6.el6               DVD-RHEL6-Repository         70 k
       php-pear                 noarch        1:1.9.0-2.el6             DVD-RHEL6-Repository        391 k
       php-pecl-apc             i686          3.1.3p1-1.2.el6.1         DVD-RHEL6-Repository         93 k
       php-pecl-memcache        i686          3.0.4-3.2.el6.2           DVD-RHEL6-Repository         59 k
       php-pgsql                i686          5.3.2-6.el6               DVD-RHEL6-Repository         63 k
       php-soap                 i686          5.3.2-6.el6               DVD-RHEL6-Repository        138 k
       php-xml                  i686          5.3.2-6.el6               DVD-RHEL6-Repository         97 k
       php-xmlrpc               i686          5.3.2-6.el6               DVD-RHEL6-Repository         50 k
      
      Transaction Summary
      ====================================================================================================
      Install      15 Package(s)
      Upgrade       0 Package(s)
      
      Total download size: 5.0 M
      Installed size: 17 M
      Downloading Packages:
      ----------------------------------------------------------------------------------------------------
      Total                                                                17 MB/s | 5.0 MB     00:00
      Running rpm_check_debug
      Running Transaction Test
      Transaction Test Succeeded
      Running Transaction
        Installing     : php-common-5.3.2-6.el6.i686                                                 1/15
        Installing     : php-pdo-5.3.2-6.el6.i686                                                    2/15
        Installing     : php-cli-5.3.2-6.el6.i686                                                    3/15
        Installing     : php-5.3.2-6.el6.i686                                                        4/15
        Installing     : php-odbc-5.3.2-6.el6.i686                                                   5/15
        Installing     : php-mysql-5.3.2-6.el6.i686                                                  6/15
        Installing     : php-pgsql-5.3.2-6.el6.i686                                                  7/15
        Installing     : php-xml-5.3.2-6.el6.i686                                                    8/15
        Installing     : php-xmlrpc-5.3.2-6.el6.i686                                                 9/15
        Installing     : php-soap-5.3.2-6.el6.i686                                                  10/15
        Installing     : php-gd-5.3.2-6.el6.i686                                                    11/15
        Installing     : php-ldap-5.3.2-6.el6.i686                                                  12/15
        Installing     : 1:php-pear-1.9.0-2.el6.noarch                                              13/15
        Installing     : php-pecl-apc-3.1.3p1-1.2.el6.1.i686                                        14/15
        Installing     : php-pecl-memcache-3.0.4-3.2.el6.2.i686                                     15/15
      
      Installed:
        php.i686 0:5.3.2-6.el6                             php-cli.i686 0:5.3.2-6.el6
        php-common.i686 0:5.3.2-6.el6                      php-gd.i686 0:5.3.2-6.el6
        php-ldap.i686 0:5.3.2-6.el6                        php-mysql.i686 0:5.3.2-6.el6
        php-odbc.i686 0:5.3.2-6.el6                        php-pdo.i686 0:5.3.2-6.el6
        php-pear.noarch 1:1.9.0-2.el6                      php-pecl-apc.i686 0:3.1.3p1-1.2.el6.1
        php-pecl-memcache.i686 0:3.0.4-3.2.el6.2           php-pgsql.i686 0:5.3.2-6.el6
        php-soap.i686 0:5.3.2-6.el6                        php-xml.i686 0:5.3.2-6.el6
        php-xmlrpc.i686 0:5.3.2-6.el6
      
      Complete!
      

    You can check the details of the PHP package using this command :

      [root@rhel6 ~]# yum info php
      Loaded plugins: rhnplugin
      This system is not registered with RHN.
      RHN support will be disabled.
      DVD-RHEL6-Repository                                                         | 3.7 kB     00:00 ...
      Installed Packages
      Name       : php
      Arch       : i686
      Version    : 5.3.2
      Release    : 6.el6
      Size       : 3.2 M
      Repo       : installed
      From repo  : DVD-RHEL6-Repository
      Summary    : PHP scripting language for creating dynamic web sites
      URL        : http://www.php.net/
      License    : PHP
      Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
                 : easy for developers to write dynamically generated webpages. PHP also
                 : offers built-in database integration for several commercial and
                 : non-commercial database management systems, so writing a
                 : database-enabled webpage with PHP is fairly simple. The most common
                 : use of PHP coding is probably as a replacement for CGI scripts.
                 :
                 : The php package contains the module which adds support for the PHP
                 : language to Apache HTTP Server.
      

    Note that you must be the root/administrator to install the package.

    How to Install php-mcrypt on CentOS 6.2

    Symptoms :
    This error appeared when i try to use phpmyadmin on authentication type as cookie. mcrypt is necessary if you want to use cookie based authentication with phpymyadmin.

    The mcrypt exension is missing. Please check your PHP configuration.

    mcrypt

    To install php-mcrypt on CentOS 6.2, follow the following steps :

    1. Download epel repository :

    [root@centos62 ~]# [root@centos62 ~]# wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
    [root@centos62 ~]# wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6

    2. Install epel repository :

    [root@centos62 ~]# rpm --import RPM-GPG-KEY-EPEL-6
    [root@centos62 ~]# rpm -i epel-release-6-5.noarch.rpm

    3. Simply run the following command to install php-mcrypt :

    [root@centos62 ~]# yum install php-mcrypt -y
    Loaded plugins: fastestmirror
    Determining fastest mirrors
    epel/metalink                                                                | 4.0 kB     00:00
     * base: centos.maulvi.net
     * epel: mirror01.idc.hinet.net
     * extras: centos.maulvi.net
     * rpmforge: fr2.rpmfind.net
     * updates: centos.maulvi.net
    CentOS6.2-Repository                                                         | 4.0 kB     00:00 ...
    CentOS6.2-Repository/primary_db                                              | 3.5 MB     00:00 ...
    base                                                                         | 3.7 kB     00:00
    base/primary_db                                                              | 3.5 MB     00:33
    epel                                                                         | 4.3 kB     00:00
    epel/primary_db                                                              | 3.5 MB     00:40
    extras                                                                       | 3.5 kB     00:00
    extras/primary_db                                                            | 6.4 kB     00:00
    rpmforge                                                                     | 1.1 kB     00:00
    rpmforge/primary                                                             | 1.5 MB     00:21
    rpmforge                                                                                  4248/4248
    updates                                                                      | 3.5 kB     00:00
    updates/primary_db                                                           | 1.1 MB     00:13
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package php-mcrypt.i686 0:5.3.3-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
    
    Transaction Summary
    ====================================================================================================
    Install       1 Package(s)
    
    Total download size: 18 k
    Installed size: 38 k
    Downloading Packages:
    php-mcrypt-5.3.3-1.el6.i686.rpm                                              |  18 kB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Warning: RPMDB altered outside of yum.
      Installing : php-mcrypt-5.3.3-1.el6.i686                                                      1/1
    
    Installed:
      php-mcrypt.i686 0:5.3.3-1.el6
    
    Complete!