Install phpMyAdmin 4.2.1 on Fedora 20/19, CentOS/RHEL 6.5/5.10

phpMyAdmin-logoThis is guide, howto install phpMyAdmin 4.2.1 with Nginx or Apache on Fedora 20/19/18/17/16, CentOS 6.5/6.4/6.3/6.2/6.1/6/5.10 and Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10 servers. phpMyAdmin needs web server with PHP and MySQL database. This guide uses Apache web server with PHP 5.5 or Nginx web server with PHP 5.5 (PHP-FPM) and Mysql 5.5 database server. You can also use your already installed versions of web server, PHP and MySQL.

If you want to install phpMyAdmin with Apache then use a – [Apache] sections and if you want install phpMyAdmin with Nginx then use b – [Nginx] sections.

1. Install Needed Web and Database Servers

[Apache]

1.1a Install the whole LAMP environment with following guide

LAMP (Linux/Apache/MySQL/PHP) on Fedora, CentOS/Red Hat (RHEL)

[Nginx]

1.1b Install the whole LEMP environment with following guide

LEMP (Linux/Nginx/MySQL/PHP) on Fedora, CentOS/Red Hat (RHEL)

OR

[Apache]

1.2a Install just MySQL and Apache with PHP using following guides

  1. Install MySQL 5.5 on Fedora, CentOS, Red Hat (RHEL)
  2. Install Apache (httpd) and PHP 5.5 on Fedora, CentOS, Red Hat (RHEL)

[Nginx]

1.2b Install just MySQL and Nginx with PHP (PHP-FPM) using following guides

  1. Install MySQL 5.5 on Fedora, CentOS, Red Hat (RHEL)
  2. Install Nginx and PHP 5.5 (PHP-FPM) on Fedora, CentOS, Red Hat (RHEL)

2. Install phpMyAdmin 4.2.1 on Fedora 20/19/18/17/16, CentOS/Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10

2.1 Change root user

2.2 Install Remi repository

Fedora

CentOS and Red Hat (RHEL)

Note: You can also use original Fedora phpMyAdmin builds or EPEL packages.

2.3 Install phpMyAdmin

If you have PHP 5.5 on CentOS/Red Hat (RHEL) then install phpMyAdmin with following command:

3. Setup phpMyAdmin with Apache or Nginx

[Apache]

3.1a Check phpMyAdmin Apache Virtual Host

When you install phpMyAdmin you got working Apache Virtual Host automatically, but if you want change it, then check /etc/httpd/conf.d/phpMyAdmin.conf file and modify it.

[Nginx]

3.1b Create phpMyAdmin Nginx Virtual Host and Other Setups

Create /etc/nginx/sites-available/phpMyAdmin file with following content:

This is Nginx phpMyAdmin virtual host configuration which works pretty much like original phpMyAdmin Apache configuration. I use here server_name pma you could freely change this real host name or some other.

Set pma pointing to localhost, add following to /etc/hosts file:

Create needed directory and enable Nginx virtual host:

[Apache]

3.2a Restart Apache Web Server

[Nginx]

3.2b Restart Nginx Web Server

4. Use phpMyAdmin

[Apache]

4.1a Open phpMyAdmin with Apache Setup

Open browser and Goto following address http://localhost/phpmyadmin.

[Nginx]

4.1b Open phpMyAdmin with Nginx Setup

Open browser and Goto following address http://pma/.

4.2 phpMyAdmin Login Screen

Login with your MySQL username and password.
phpMyAdmin Login

[Apache]

4.3a phpMyAdmin 3.4.10 Running on CentOS 6.2 with Apache

phpMyAdmin 3.4.10.1 Apache CentOS 6.2

[Nginx]

4.3b phpMyAdmin 3.4.10 Running on CentOS 6.2 with Nginx

phpMyAdmin 3.4.10.1 Nginx CentOS 6.2

Share this post

115 Comments

  1. Hi JR,

    I tried to follow your steps. I install Remi repository.

    Reply
    • Reply
    • I install phpMyAdmin.

      Reply
      • Hi dhenyismail,

        Please run first following command:

        Then, could you post output of following commands:

        Reply
  2. Hi!
    Great tutorial, but I have a minor problem.
    When I try to install phpmyadmin with:

    I get these errors:

    I’ve tried doing the yum clean all. So here’s the output of yum –enablerepo repolist and yum –enablerepo=remi info phpmyadmin:

    Oh, and other informations:

    OS: CentOS 6.5 (Final)
    Web service: nginx
    PHP version: 5.5.12

    I hope you can help me resolve these problems.

    Reply
    • Hi UltraG33k,

      I have to update this guide, when I have time to test this on every system.

      Try following install command instead:

      Reply
      • yes I was having the same problem but this seems to have solved it, just changed 55 to 56 for my system fedora 20 php5.6.

        Reply
  3. That worked perfectly! Thanks again for a great tutorial :)

    Reply
    • Excellent, you are welcome! I will update and check this guide soon with latest version.

      Reply
  4. Hello, I struggled for two days and fail to install phpmyadmin.
    My configuration is: vps, centos 6, nginx, mysql. I tried everything you wrote and every time I get “This page can’t be displayed”. I do not know what to do, perhaps I’ll send my account details that you look there?

    Thanks for everything you do for us.

    Reply
  5. Now I have this error:

    Reply
  6. Hi JR,

    I have RHEL server 6.5. I followed your instructions to installed Apache 2.2, PHP 5.5.13, MySQL 5.5.38. They work great!
    However when I install phpmyadmin with yum –enablerepo=remi,remi-php55 install phpmyadmin
    I got this error:
    Error: Package: php-recode-5.5.13-3.el6.remi.x86_64 (remi-php55)
    Requires: librecode.so.0()(64bit)
    You could try using –skip-broken to work around the problem
    You could try running: rpm -Va –nofiles –nodigest

    Would you please help me out? Thanks a lot!
    Isabella

    Reply
  7. Hi JR,

    I follow your instruction to install Apache Server, MySQL and phpadmin.
    However, after the installation, I got a 404 not found error when I try to test myphpmin on http://localhost/phpmyadmin.
    Is there anything I can check to find out the problem?
    Thanks a lot!!

    Reply
    • I found the solution!

      Just to soft link the folder from /usr/share/phpMyAdmin to /var/www/html:
      sudo ln -s /usr/share/phpMyAdmin /var/www/html/phpMyAdmin

      Thanks a lot!!

      Reply
  8. Pretty! This has been an extremely wonderful post. Thanks for supplying this information.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">