Site hosted by Angelfire.com: Build your free website today!

Install phpMyAdmin

We are now on the last leg of our journey, the installation of phpMyAdmin. This, I would say, is the easiest bit, as most of the configuration that needs doing has been done, and all this involves is copying some files and putting some information into a small configuration file to make phpMyAdmin work with MySQL.

Find and open the zip file that you downloaded then extract its contents to c:server\Apache2\htdocs\, all of the files will extract into the directory structure needed, however the main folder will have a name which, depending on the version you downloaded, will look something like phpMyAdmin-2.11.7-all-languages, now rename the main folder “phpmyadmin” ending up with the directory structure shown below.

We now have everything that we need installed in the one location, which will make life so much easier if any future problems are encountered. We no need to make sure that phpMyAdmin is working, so fie up your favourite browser once more and enter http://localhost/phpmyadmin/index.php into the address bar. You may get an error message like the one below;-

which means that you missed a bit in the configuration of PHP, and did not uncomment (that is to remove the ; from the beginning of a line) these lines in the php.ini file:-

;extension=php_mbstring.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
So, open up the php.ini file once more, find the lines above and make sure that the ; is removed from the beginning of each line. Now save the file and Restart Apache, re-open your browser and try http://localhost/phpmyadmin/index.php once again and all should be well, but with the error shown below:-



this is because we have not yet configured phpMyAdmin to recognise MySQL properly, and that phpMyAdmin needs the password created when installing MySQL to connect.

We now need to navigate to c:server\Apache2\htdocs\phpmyadmin\ and find a file named config.inc.php, if it is not there you will see a file named config.sample.inc.php, simply rename this file to config.inc.php by removing the .sample immediately after the config bit, then open it, it should look something like this.

>?php /*
* Generated configuration file
* Generated by: phpMyAdmin 2.11.7 setup script
* Version: $Id: setup.php 10748 2007-10-10 07:30:59
* Date: Fri, 27 Jun 2008 08:49:24 GMT
*/

$cfg['PmaAbsoluteUri'] = ''; // path for phpMyAdmin

/* Servers configuration */
$i = 0;

/* Server localhost (config:root) [1] */
$i++;
$cfg['Servers'][$i]['host'] = '';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['pmadb'] = ''; // Database used for Relation, Bookmark and PDF Features

/* End of servers configuration */

?<
This sample was copied from my installation, but I removed all of the settings that need to be entered to show what the basic config.inc.php file will look like, at least more or less, as they tend to differ from version to version.

Now we need to tell phpMyAdmin the location of installation, so find this line:-

$cfg['PmaAbsoluteUri'] = '';
and change it to:-
$cfg['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin/';
If this line is not there then you can either type it in or copy and paste the line above into the file.

phpMyAdmin uses three authentication methods

1. config method (the default method)
2. http method
3. cookie method (recommended method)
As we are installing into a learning/development environment I will concentrate on the first (default) authentication method. If we were installing into a production environment where security were of the utmost importance then we would use the third most secure method.

Now do the following:-

find - $cfg['Servers'][$i]['host'] = '';
and change it to - $cfg['Servers'][$i]['host'] = 'localhost';
find - $cfg['Servers'][$i]['auth_type'] = ' ';
and change it to - $cfg['Servers'][$i]['auth_type'] = 'config'; - (that is if it is not already set at the config (default) setting)
find - $cfg['Servers'][$i]['user'] = ' ';
and change it to - $cfg['Servers'][$i]['user'] = 'root'; - (again if it is not already set to ‘root’)
find - $cfg['Servers'][$i]['password'] = ' ';
and change it to - $cfg['Servers'][$i]['password'] = 'Put your password in here';
find - $cfg['Servers'][$i]['pmadb'] = ''; // Database used for Relation, Bookmark and PDF Features
and change it to - $cfg['Servers'][$i]['pmadb'] = 'pmadb'; - (or whatever you want to call your phpMyAdmin database)
Once again we need to fire up our favourite browser and point it to http://localhost/phpmyadmin/index.php, there is a possibility that you may get the following error message:-



if you have not on the two previous occasions uncommented this line:-

;extension=php_mbstring.dll
in the php.ini file; if this is the case then that is the next thing that needs doing.
Don’t Forget: every time you alter the php.ini file you need to Restart Apache.

Having made the change, if necessary re-open you browser and point it once again at http://localhost/phpmyadmin/index.php, and if all is well you should see the following screen, or something like it:-

If you are seeing this then everything is working as it should, if not then some troubleshooting of the configuration files is needed. Although I am sure that if you have followed all of the above instructions closely there will not be a problem, but if there is it is probably one that I have not encountered and have not covered here. In which case I would suggest heading off to a forum like PHP Freaks, where there are any number of solutions to any number of problems, and very many talented people who will help find the answer to your specific problem.

Previous < Install PHP

Website designed and maintained by Alf Thomas - all content © Alf's Art 2003-2008