To install phpMyAdmin on a CentOS system running an Apache webserver, login as root and issue the command
yum install phpmyadmin from a command
prompt.
Note: you may have to install the Remi Repository or the RPMForge Repository
to be able to locate and install phpMyAdmin. Instructions for configuring
yum to use one of those repositories can be found via the links
below.
Remi Repository
RPMForge
Repository
After installing the software you will need to restart Apache, which you
can do with apachectl restart or service httpd restart
. You can then try accessing phpMyAdmin by
http://example.com/phpmyadmin substituting your domain name or
IP address for example.com.
If you receive a "403 Forbidden" error with the message "You don't have permission to access /phpmyadmin on this server.", it is likely because you are attempting to access the software from outside of the server itself. The orginal phpmyadmin.conf file contains the lines below:
#
# Web application to manage MySQL
#
<Directory "/usr/share/phpmyadmin">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
The Deny from all line states that the default behavior
is to prevent any IP address from accessing phpMyAdmin. The next line,
Allow from 127.0.0.1 provides for the exception of accessing
the software from the server itself, i.e., the "localhost" address
127.0.0.1. You could change the "deny from all" to "allow from
all" to allow access from anywhere or put a "#" at the beginning of the line
to comment it out. Or, you could add additional IP addresses or
FQDN's after the
127.0.0.1 to allow access to phpMyAdmin from other systems.
E.g. you could change the line to Allow from 127.0.0.1 192.168
to also allow access from any IP address beginning with 192.168. Restart
Apache again.
If you then try accessing phpMyAdmin, e.g., you might use
http://192.168.0.10/phpmyadmin, if 192.168.0.10 was your
webserver's IP address, but get the error message The
configuration file now needs a secret passphrase (blowfish_secret).
then you need to edit /usr/share/phpmyadmin/config.inc.php.
Look for the following lines:
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
Place a password between the two single quotes, e.g., you could have a
password of SomeGoodPassword with the following:
$cfg['blowfish_secret'] = 'SomeGoodPassword';
If you refresh the webpage, you should then see a phpMyAdmin login window where you are prompted to enter a username and password, which should be the mysql root account and it's password.
For further information on phpMyAdmin and MySQL, there is a book by Marc Delisle, Mastering phpMyAdmin for Effective MySQL Management.
References:
- phpMyAdmin
-
RPMForge Packages and Yum Priorites
Date: May 3, 2008
MoonPoint Support -
Remi Repository
Antoine Solutions Development A Free PHP IDE built on Open Source Software -
Quick 'n' Easy LAMP Server For CentOS/RHEL
By: olddocks
Date: May 28, 2008
HowtoForge - Linux Howtos and Tutorials
