First of all, you must ensure your LAMP has been installed and is running well. If you are looking for LAMP solutions, you may refer to the following posts:
Now, let's see how we install phpMyAdmin well.
First of all, search for a proper phpMyAdmin package.
[root@localhost ~]# yum --enablerepo=remi info phpmyadmin
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirror.neu.edu.cn
* epel: mirrors.hustunique.com
* extras: mirrors.btte.net
* remi: mirror.smartmedia.net.id
* updates: mirror.neu.edu.cn
remi | 2.9 kB 00:00
Available Packages
Name : phpMyAdmin
Arch : noarch
Version : 4.0.4.1
Release : 1.el6.remi
Size : 4.3 M
Repo : remi
Summary : Web based MySQL browser written in php
URL : http://www.phpmyadmin.net/
License : GPLv2+
Description : phpMyAdmin is a tool written in PHP intended to handle the administration of
: MySQL over the Web. Currently it can create and drop databases,
: create/drop/alter tables, delete/edit/add fields, execute any SQL statement,
: manage keys on fields, manage privileges,export data into various formats and
: is available in 50 languages
If everything is OK, then install the package.
[root@localhost ~]# yum --enablerepo=remi install phpmyadmin
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirror.neu.edu.cn
* epel: mirrors.hustunique.com
* extras: mirrors.btte.net
* remi: mirror.smartmedia.net.id
* updates: mirror.neu.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package phpMyAdmin.noarch 0:4.0.4.1-1.el6.remi will be installed
--> Processing Dependency: php-xmlwriter for package: phpMyAdmin-4.0.4.1-1.el6.remi.noarch
--> Processing Dependency: php-tcpdf-dejavu-sans-fonts for package: phpMyAdmin-4.0.4.1-1.el6.remi.noarch
--> Processing Dependency: php-tcpdf for package: phpMyAdmin-4.0.4.1-1.el6.remi.noarch
--> Processing Dependency: php-recode for package: phpMyAdmin-4.0.4.1-1.el6.remi.noarch
--> Processing Dependency: php-php-gettext for package: phpMyAdmin-4.0.4.1-1.el6.remi.noarch
--> Processing Dependency: php-mcrypt for package: phpMyAdmin-4.0.4.1-1.el6.remi.noarch
--> Processing Dependency: php-mbstring for package: phpMyAdmin-4.0.4.1-1.el6.remi.noarch
--> Processing Dependency: php-bcmath for package: phpMyAdmin-4.0.4.1-1.el6.remi.noarch
--> Running transaction check
---> Package php-bcmath.x86_64 0:5.4.17-2.el6.remi will be installed
---> Package php-mbstring.x86_64 0:5.4.17-2.el6.remi will be installed
---> Package php-mcrypt.x86_64 0:5.4.17-2.el6.remi will be installed
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: php-mcrypt-5.4.17-2.el6.remi.x86_64
---> Package php-php-gettext.noarch 0:1.0.11-4.el6.remi will be installed
---> Package php-recode.x86_64 0:5.4.17-2.el6.remi will be installed
--> Processing Dependency: librecode.so.0()(64bit) for package: php-recode-5.4.17-2.el6.remi.x86_64
---> Package php-tcpdf.noarch 0:6.0.020-1.el6.remi will be installed
--> Processing Dependency: php-tidy for package: php-tcpdf-6.0.020-1.el6.remi.noarch
---> Package php-tcpdf-dejavu-sans-fonts.noarch 0:6.0.020-1.el6.remi will be installed
---> Package php-xml.x86_64 0:5.4.17-2.el6.remi will be installed
--> Running transaction check
---> Package libmcrypt.x86_64 0:2.5.8-9.el6 will be installed
---> Package php-tidy.x86_64 0:5.4.17-2.el6.remi will be installed
--> Processing Dependency: libtidy-0.99.so.0()(64bit) for package: php-tidy-5.4.17-2.el6.remi.x86_64
---> Package recode.x86_64 0:3.6-28.1.el6 will be installed
--> Running transaction check
---> Package libtidy.x86_64 0:0.99.0-19.20070615.1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Installing:
phpMyAdmin noarch 4.0.4.1-1.el6.remi remi 4.3 M
Installing for dependencies:
libmcrypt x86_64 2.5.8-9.el6 epel 96 k
libtidy x86_64 0.99.0-19.20070615.1.el6 base 127 k
php-bcmath x86_64 5.4.17-2.el6.remi remi 58 k
php-mbstring x86_64 5.4.17-2.el6.remi remi 942 k
php-mcrypt x86_64 5.4.17-2.el6.remi remi 49 k
php-php-gettext noarch 1.0.11-4.el6.remi remi 20 k
php-recode x86_64 5.4.17-2.el6.remi remi 35 k
php-tcpdf noarch 6.0.020-1.el6.remi remi 1.8 M
php-tcpdf-dejavu-sans-fonts noarch 6.0.020-1.el6.remi remi 82 k
php-tidy x86_64 5.4.17-2.el6.remi remi 53 k
php-xml x86_64 5.4.17-2.el6.remi remi 168 k
recode x86_64 3.6-28.1.el6 base 712 k
Transaction Summary
=============================================================================================================================
Install 13 Package(s)
Total download size: 8.3 M
Installed size: 33 M
Is this ok [y/N]: y
Downloading Packages:
(1/13): libmcrypt-2.5.8-9.el6.x86_64.rpm | 96 kB 00:00
(2/13): libtidy-0.99.0-19.20070615.1.el6.x86_64.rpm | 127 kB 00:00
(3/13): php-bcmath-5.4.17-2.el6.remi.x86_64.rpm | 58 kB 00:00
(4/13): php-mbstring-5.4.17-2.el6.remi.x86_64.rpm | 942 kB 00:02
(5/13): php-mcrypt-5.4.17-2.el6.remi.x86_64.rpm | 49 kB 00:00
(6/13): php-php-gettext-1.0.11-4.el6.remi.noarch.rpm | 20 kB 00:00
(7/13): php-recode-5.4.17-2.el6.remi.x86_64.rpm | 35 kB 00:00
(8/13): php-tcpdf-6.0.020-1.el6.remi.noarch.rpm | 1.8 MB 00:07
(9/13): php-tcpdf-dejavu-sans-fonts-6.0.020-1.el6.remi.noarch.rpm | 82 kB 00:00
(10/13): php-tidy-5.4.17-2.el6.remi.x86_64.rpm | 53 kB 00:00
(11/13): php-xml-5.4.17-2.el6.remi.x86_64.rpm | 168 kB 00:00
(12/13): phpMyAdmin-4.0.4.1-1.el6.remi.noarch.rpm | 4.3 MB 00:16
(13/13): recode-3.6-28.1.el6.x86_64.rpm | 712 kB 00:01
-----------------------------------------------------------------------------------------------------------------------------
Total 265 kB/s | 8.3 MB 00:32
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-mbstring-5.4.17-2.el6.remi.x86_64 1/13
Installing : php-xml-5.4.17-2.el6.remi.x86_64 2/13
Installing : php-bcmath-5.4.17-2.el6.remi.x86_64 3/13
Installing : php-php-gettext-1.0.11-4.el6.remi.noarch 4/13
Installing : libmcrypt-2.5.8-9.el6.x86_64 5/13
Installing : php-mcrypt-5.4.17-2.el6.remi.x86_64 6/13
Installing : recode-3.6-28.1.el6.x86_64 7/13
Installing : php-recode-5.4.17-2.el6.remi.x86_64 8/13
Installing : libtidy-0.99.0-19.20070615.1.el6.x86_64 9/13
Installing : php-tidy-5.4.17-2.el6.remi.x86_64 10/13
Installing : php-tcpdf-6.0.020-1.el6.remi.noarch 11/13
Installing : php-tcpdf-dejavu-sans-fonts-6.0.020-1.el6.remi.noarch 12/13
Installing : phpMyAdmin-4.0.4.1-1.el6.remi.noarch 13/13
Verifying : phpMyAdmin-4.0.4.1-1.el6.remi.noarch 1/13
Verifying : libtidy-0.99.0-19.20070615.1.el6.x86_64 2/13
Verifying : php-tidy-5.4.17-2.el6.remi.x86_64 3/13
Verifying : php-tcpdf-6.0.020-1.el6.remi.noarch 4/13
Verifying : php-mcrypt-5.4.17-2.el6.remi.x86_64 5/13
Verifying : php-php-gettext-1.0.11-4.el6.remi.noarch 6/13
Verifying : recode-3.6-28.1.el6.x86_64 7/13
Verifying : php-bcmath-5.4.17-2.el6.remi.x86_64 8/13
Verifying : php-recode-5.4.17-2.el6.remi.x86_64 9/13
Verifying : php-mbstring-5.4.17-2.el6.remi.x86_64 10/13
Verifying : php-tcpdf-dejavu-sans-fonts-6.0.020-1.el6.remi.noarch 11/13
Verifying : libmcrypt-2.5.8-9.el6.x86_64 12/13
Verifying : php-xml-5.4.17-2.el6.remi.x86_64 13/13
Installed:
phpMyAdmin.noarch 0:4.0.4.1-1.el6.remi
Dependency Installed:
libmcrypt.x86_64 0:2.5.8-9.el6 libtidy.x86_64 0:0.99.0-19.20070615.1.el6
php-bcmath.x86_64 0:5.4.17-2.el6.remi php-mbstring.x86_64 0:5.4.17-2.el6.remi
php-mcrypt.x86_64 0:5.4.17-2.el6.remi php-php-gettext.noarch 0:1.0.11-4.el6.remi
php-recode.x86_64 0:5.4.17-2.el6.remi php-tcpdf.noarch 0:6.0.020-1.el6.remi
php-tcpdf-dejavu-sans-fonts.noarch 0:6.0.020-1.el6.remi php-tidy.x86_64 0:5.4.17-2.el6.remi
php-xml.x86_64 0:5.4.17-2.el6.remi recode.x86_64 0:3.6-28.1.el6
Complete!
You can see phpmyadmin requires a lot of extra PHP modules to run with.
Try it on local browser.
http://localhost/phpmyadmin/
It would be no problem to show the login page on localhost.
But if you access it (e.g. http://www.example.com/phpmyadmin) from a remote client, you will see the following error:
Apache/2.2.25 (CentOS) Server at www.example.com Port 80
To conquer the problem, you should modify the configuration file of phpmyadmin and make httpd allowed to be accessed. For example, we would like to make a client from 10.1.2.59 allowed to access phpmyadmin. You can add your ip address range that is marked as yellow below. It depends on what version of httpd you're using.
[root@localhost ~]# vi /etc/httpd/conf.d/phpMyAdmin.conf
...
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1 10.73.12.0/24
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1 10.73.12.0/24
Allow from ::1
</IfModule>
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1 10.73.12.0/24
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1 10.73.12.0/24
Allow from ::1
</IfModule>
</Directory>
...
Then restart httpd
[root@localhost ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
Now, connect it again from the allowed client. It should work now.