Page 1 of 1

Installing / Configuring PHP & MySQL

Posted: Tue Jun 30, 2009 10:07 pm
by villeit
Hi, I am a recent convert from Microsoft to the Opensource community, so please bear with me. (Oh this is my first post in this forum :D)

First some stats about my setup:
OS: Windows Vista 32 Bit
PHP: Version 5.2.9-2
Database: MySQL 5.1.35-win32
Trying to install: PHPMyAdmin3.2.0
Webserver: Apache 2.2.11

I have already developed a (basic) PHP website and I can call the phpinfo() to see all the information about my PHP installation so I believe the webserver and PHP installation seems to be up and running correctly.

The Database msi file was fine to install and configure. I used the "developer" configuration from the installation wizard.
But as I understand, MySQL does not provide a Client application for managing your databases. Anyways, I found this application called phpMyAdmin which seems to do the job.

In the php.ini I have added following lines to ensure the MySQL extensions are utilised:

Under section "Paths and Directories":
extension_dir ="C:\Program Files\PHP\ext"

I had to manually create the ext directory as it was not there from the original installation.

Under section "Dynamic Extensions":
extension=php_msqli.dll

I downloaded the above php_msqli.dll and libmysql.dll from here and dropped them in the ext directory of my PHP installation.

I configured the file config.inc.php in the root directory of MyPHPAdmin. Here is an excerpt from that:

Code: Select all

 
<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 3.2.0 setup script by Piotr Przybylski <piotrprz@gmail.com>
 * Date: Tue, 30 Jun 2009 09:41:20 +0000
 */
 
/* Servers configuration */
 
$i=0;
 
/* Server: My local dev machine [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'My local dev machine';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'xxxxxxx';
$cfg['Servers'][$i]['ssl'] = false;
$cfg['Servers'][$i]['SignonURL'] = 'scripts/signon.php';
 
/* End of servers configuration */
 
$cfg['blowfish_secret'] = '4a49d8a327d8e5.15294135';
$cfg['ShowPhpInfo'] = true;
$cfg['SQLQuery'] = array (
  'Validate' => true,
);
$cfg['Export'] = array (
  'charset' => 'utf-8',
);
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
$cfg['GZipDump'] = false;
$cfg['BZipDump'] = false;
$cfg['ZipDump'] = false;
$cfg['ForceSSL'] = false;
$cfg['DefaultLang'] = 'en-utf-8';
$cfg['ServerDefault'] = 1;
?>
 
So to my problem:
When I try to load the phpMyAdmin locally on my browswer I get the following error:

"phpMyAdmin - Error
Cannot load mysqli extension. Please check your PHP configuration. - Documentation".

I am thankful for any suggestions!

// Ville

Re: Installing / Configuring PHP & MySQL

Posted: Wed Jul 01, 2009 2:39 am
by Salaria
Hi,

Please make sure that you followed the exact steps as follows:

1. Stop your web server.
2. Rename the php_mysqli.dll in your C:\php\ext folder to php_mysqli.dll.old just in case you need to revert back.
3. Copy php_mysqli.dll into your C:\php\ext folder.
4. Rename the libmysqli.dll in your C:\php folder to libmysqli.dll.old just in case you need to revert back.
5. Copy libmysqli.dll into your C:\php folder.
6. Start your web server.

One thing more, if you have old php_mysqli.dll file bundled with PHP the just remove the comment from php.ini and restart your webserver to make it work.