views:

127

answers:

5

I've installed php on my xp, but failed to add an extension to mysql

Here is what I did in php.ini:

[PHP_MYSQL]
extension=php_mysql.dll

and there is such a file in ext/

but when I look into phpinfo(), only to find that mysql extension is still not added.

What have I did wrongly?

A: 

Are you using Apache? If so, check php.ini in apache\bin as this may be the ini file is use.

As Evgeniy Savichev pointed out, the name of the file being parsed is displayed in phpinfo under 'Loaded Configuration File'

Lunatik
You can use phpinfo() to see what ini file was parsed in fact.
Jet
Yes,I've done that,and I'm modifying the right php.ini file.
Shore
+1  A: 

In your php.ini file do the following:

extension=ext/php_mysql.dll

This should exist under the [PHP] configuration section, not [PHP_MYSQL].

Kev
I've tried put that in [PHP] section first,but not working,so put it to [PHP_MYSQL] section,still in vain.I've installed another extension memcache,without ext/,so I think it'll not help.
Shore
A: 

Make sure that you have the mysql client DLLs installed and somewhere on %PATH%. Also, you can use a tool like depwalker to load the php_mysql.dll and see what the missing dynamic linkage is.

TML
A: 

To avoid the configuration problems, I would install XAMPP (http://www.apachefriends.org/en/xampp.html) which installs php, apache and mysql and configures it all as a working server installation.

Choog
+1  A: 

[PHP_MYSQL]

wouldn't this bit cause problems? guessing.

Michal M