TecMint.com is a community driven Linux website. Our motto is to provide an effortless howto’s to our valuable readers.

You are also welcome to join our community and can be part of our team, contributing and submitting well written article on Linux. If you have any query, please contact us by email tecmint.com [at] gmail [dot] com or use our contact form.

Install PhpMyAdmin 3.5.7 for Apache or Nginx on RHEL/CentOS 6.3/5.9 Fedora 18-12

MySQL administration via command-line in Linux is much difficult job for any newbie system administrator or database administrator, because it contains numerous commands which we cannot remember in our daily life. To make MySQL administration much easier we’re introducing a newly released web based MySQL administration tool called PhpMyAdmin 3.5.7, with the help of this tool you can control and manage your database administration via browser easily.

Install PhpMyAdmin for Apache or Nginx

Install PhpMyAdmin for Apache or Nginx

What Is PhpMyAdmin?

PhpMyAdmin is an open source and most popular web based MySQL administration application for handling MySQL databases. It was written in PHP language, through this application you can do various MySQL administration tasks such as create, drop, alter, delete, import, export, search, query, repair, optimize and run other database management command via browser.

In this article we’re going to learn how to install latest released PhpMyAdmin 3.5.7 for Apache or Nginx on RHEL 6.3/6.2/6.1/6/5.9/5.8, CentOS 6.3/6.2/6.1/6/5.9/5.8 and Fedora 18,17,16,15,14,13,12 systems using Yum repositories.

Here we’ve provided installation of PhpMyAdmin 3.5.7 for both the web server’s Apache or Nginx. So, its up-to you which web server to choose for installation. But remember you must have working LAMP (Linux, Apache, PHP and MySQL) or LEMP (Linux, Nginx, PHP and MySQL) setup installed on your working system. If you don’t have any of them, then follow our below articles to setup.

Read Also : SQL Buddy (A Lightweight MySQL Administration) Tool for RHEL / CentOS / Fedora

Install Linux – RHEL 6, CentOS 6.3, Fedora 18 and Fedora 17

  1. Red Hat Enterprise Linux (RHEL) 6 Installation Guide with Screenshots
  2. CentOS 6.3 Step by Step Installation Guide with Screenshots
  3. Fedora 18 Step by Step Installation Guide with Screenshots
  4. Fedora 17 Step by Step Installation Guide with Screenshots

Install LAMP (Linux, Apache, MySQL, PHP) Setup

  1. Install Apache, MySQL 5.5.30 & PHP 5.4.11 on RHEL/CentOS 5-6 & Fedora 12-18

Install LEMP (Linux, Nginx, MySQL, PHP) Setup

  1. Install LEMP (Linux, Nginx, MySQL, PHP) on RHEL/CentOS 5-6 & Fedora 12-17

Install phpMyAdmin 3.5.7 on RHEL/CentOS 6.3/5.9 Fedora 18-12

Step 1: Install Required Repositories for PhpMyAdmin 3.5.7

First, install dependency packages using following repositories.

[For RHEL/CentOS 6.3/5.9 - 32 Bit OS]
## Epel Dependency on RHEL/CentOS 6 ##
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

## Remi Dependency on RHEL/CentOS 6 ##
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

## Epel Dependency on RHEL/CentOS 5 ##
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

## Remi Dependency on RHEL/CentOS 5 ##
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
[For RHEL/CentOS 6.3/5.9 - 64 Bit OS]
## Epel Dependency on RHEL/CentOS 6 ##
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

## Remi Dependency on RHEL/CentOS 6 ##
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

## Epel Dependency on RHEL/CentOS 5 ##
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

## Remi Dependency on RHEL/CentOS 5 ##
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
[For Fedora 18-12]
## Remi Dependency on Fedora 18,17,16,15,14,13,12 ##
# rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm 
# rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

## Remi Dependency on Fedora 18 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-18.rpm

## Remi Dependency on Fedora 17 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-17.rpm

## Remi Dependency on Fedora 16 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-16.rpm

## Remi Dependency on Fedora 15 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-15.rpm

## Remi Dependency on Fedora 14 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-14.rpm

## Remi Dependency on Fedora 13 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-13.rpm

## Remi Dependency on Fedora 12 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-12.rpm

Step 2: Install PhpMyAdmin 3.5.7

Once you’ve installed above repositories, you can run the following command to install it.

# yum --enablerepo=remi install phpmyadmin

Note : If your are using PHP 5.4 on RHEL/CentOS systems, then you need to run the below command to install it.

# yum --enablerepo=remi,remi-test install phpmyadmin

Step 3: Configuring PhpMyAdmin 3.5.7 for Apache or Nginx

[For Apache]

In Apache you don’t need to setup any Virtual Host for phpMyAdmin, because you will get working phpMyAdmin automatically. The main configuration file is located under /etc/httpd/conf.d/phpMyAdmin.conf.

[For Nginx]

For Nginx you need to setup and create Virtual Host file manually by creating following file.

# vi etc/nginx/sites-available/phpMyAdmin

Add the following whole code to it, save and exit. In the below configuration file, I have chosen server name as tecmint, you could change it to any as per your choice.

server {
       listen   80;
       server_name tecmint;
       access_log /var/log/nginx/phpmyadmin/access.log;
       error_log /var/log/nginx/phpmyadmin/error.log;
       root /usr/share/phpMyAdmin;

       location / {
           index  index.php;
       }

       ## Images and static content is treated different
       location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
           access_log        off;
           expires           360d;
       }

       location ~ /\.ht {
           deny  all;
       }

       location ~ /(libraries|setup/frames|setup/libs) {
           deny all;
           return 404;
       }

       location ~ \.php$ {
           include /etc/nginx/fastcgi_params;
           fastcgi_pass 127.0.0.1:9000;
           fastcgi_index index.php;
           fastcgi_param SCRIPT_FILENAME /usr/share/phpMyAdmin$fastcgi_script_name;
       }
}

Now set server name tecmint to localhost, To do this, just add the following entry in your /etc/hosts file.

127.0.0.1  tecmint

Now create required directory and enable Nginx virtual host for phpmyadmin.

# mkdir -p /var/log/nginx/phpmyadmin
# cd /etc/nginx/sites-enabled
# ln -s /etc/nginx/sites-available/phpMyAdmin

Step 4: Restarting Apache or Nginx Service

Once you all set, now restart the service based on your selected web server.

[Restart Apache]
# /etc/init.d/httpd restart
OR
# service httpd restart
[Restart Nginx]
# /etc/init.d/nginx restart
OR
# service nginx restart

Step 5: Starting PhpMyAdmin 3.5.7

[Start PhpMyAdmin 3.5.7 on Apache]

Open your browser and type the URL as http://localhost/phpmyadmin.

PhpMyAdmin Welcome Screen in Apache

PhpMyAdmin Welcome Screen in Apache

[Start PhpMyAdmin 3.5.7 on Nginx]

Open your browser and type the URL as http://tecmint.

PhpMyAdmin Welcome Screen in Nginx

PhpMyAdmin Welcome Screen in Nginx


8 Responses

  1. # cd /etc/nginx/sites-enabled should be sites-available as per your original quote

  2. Pejman says:

    Dear Ravi,

    Please write some articles about Nginx and its installation on CentOS

  3. Mateoo says:

    Hi,
    i have problem, after the installation process displays a message to me at phpmy admin: You do not have permission to access / phpmyadmin on this server .. Please help

  4. Ravi Saive says:

    Open this /etc/httpd/conf.d/phpMyAdmin.conf with vi editor and add your IP address in allow from and then restart web service.

  5. Paul Srch says:

    When I use the setup facility to configure phpMyAdmin after this, I can’t seem to figure out where to move the config.inc.php file. I’ve done a “find” and have come up with these three directories:

    /etc/phpMyAdmin
    /var/lib/phpMyAdmin
    /usr/share/phpMyAdmin

    Once I’ve done the setup utility, I get the message to move config/config.inc.php from the config directory to the main directory for phpMyAdmin. The one in /var/lib/phpMyAdmin/config/config.inc.php seems to have the changes I made, and I moved it to /var/lib/phpMyAdmin/config.inc.php, and then logged out and back in, but the changes did not seem to be there.

    Any ideas?

  6. Souradip Roy says:

    Every time when I am trying to install php,it is showing me the following error PLEASE HELP ……….. please show me a way to resolve this php-gd-5.4.13-1 problem ……

    Error: Package: php-gd-5.4.13-1.el6.remi.i686 (remi)
    Requires: libjpeg.so.62(LIBJPEG_6.2)
    Error: Package: php-gd-5.4.13-1.el6.remi.i686 (remi)
    Requires: php-common(x86-32) = 5.4.13-1.el6.remi
    Installed: php-common-5.5.0-0.22.beta2.el6.remi.i686 (@remi-test)
    php-common(x86-32) = 5.5.0-0.22.beta2.el6.remi
    Available: php-common-5.3.2-6.el6.i686 (rhel6repo)
    php-common(x86-32) = 5.3.2-6.el6
    Available: php-common-5.4.12-1.el6.remi.i686 (remi)
    php-common(x86-32) = 5.4.12-1.el6.remi
    Available: php-common-5.4.13-1.el6.remi.i686 (remi)
    php-common(x86-32) = 5.4.13-1.el6.remi
    You could try using –skip-broken to work around the problem
    You could try running: rpm -Va –nofiles –nodigest

    • Ravi Saive says:

      To overcome this issue, first remove the php-gd and php-common packages using.

      yum remove php-gd php-common
      

      and then try again to install php. I hope it will work..

Leave a Reply

Proudly designed by Tecmint.com.