How to Install phpmyadmin in CentOS / RedHat / Fedora

Step 1: Prerequisites

Step 2: Download Package

Download rpm package for CentOS / RedHat /Fedora

# rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm
# yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
# yum check-update

Step 3: Install phpmyadmin

# yum install phpMyAdmin

Step 4: Reload Apache Service

# service httpd restart

Step 5: Check on Browser

Open your favorite browser and Hit the  URL:http://192.168.1.1/phpMyAdmin

Troubleshooting

»  #2002 – Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
The server is not responding (or the local server’s socket is not correctly configured).
( This means your mysql server service is stopped , you must start the service  “service mysql start”)

» You don’t have permission to access /phpMyAdmin/ on this server.
Open /etc/httpd/conf.d/phpMyAdmin.conf file and find the lines “Deny from All” and comment those lines and restart httpd service

vi /etc/httpd/conf.d/phpMyAdmin.conf

» If you are installing phpmyadmin on Redhat 7 you may face this issue:
Error: Package: php-php-gettext-1.0.11-10.el7.noarch (epel)
Requires: php-mbstring
Error: Package: php-tcpdf-6.0.091-1.el7.noarch (epel)
Requires: php-bcmath
Error: Package: phpMyAdmin-4.2.8.1-2.el7.noarch (epel)
Requires: php-mbstring >= 5.3.0
Error: Package: php-tcpdf-6.0.091-1.el7.noarch (epel)
Requires: php-mbstring
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest

In order to resolve this issue follow the following steps:

# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/7/x86_64/yum-plugin-replace-0.2.7-1.ius.el7.noarch.rpm

Install yum replace package and replace entire PHP stack

# rpm -i yum-plugin-replace-0.2.7-1.ius.el7.noarch.rpm 
# yum replace php --replace-with php56u

How To Install Apache (Web Server) in Linux

For Fedora / RHEL / Cent OS Linux

Step 1: Install apache

# yum install httpd

Step 2: Start apache

To start the Apache/httpd, run:

# /etc/init.d/httpd start
OR
# service httpd start

Also configure httpd service to start on system start.

# chkconfig httpd on

Note: The default directory in Fedora / RHEL / Cent OS Linux operating system is “/var/www/html”

Step 3: Verify apache Port

To verify the httpd port is open or not use the command:

# netstat -antp | grep :80

For Debian / Ubuntu

Step 1: Install apache

Use the apt-get command:

# apt-get install apache2

Step 2: Start apache

# /etc/init.d/apache2 start

Note: The default directory in Debian / Ubuntu Linux operating system is /var/www/

Installation from CD/DVD

We can also install httpd from CDROM with rpm command:

# rpm -ivh httpd*