...

View Full Version : Getting Mysql Extension to load in PHP



teaorcoffee
02-19-2010, 08:05 PM
[note to moderator: the other answers similar to this on this forum do not solve my problem]

Although I have checked everything I can think of, the mysql extebsion in PHP will not intitlaise. Can you help?

When I run phpinfo() "mysql" is not mentioned at all; consequently PHPMyAdmin won't start (Error message: phpMyAdmin - Error
Cannot load mysql extension. Please check your PHP configuration.)

What I am using:
PHP version: 5.2.12
MySQL version: 5.1.44
Windows 7
IIS7.5


In Php.ini
I have uncommented:
extension=php_mysql.dll
extension=php_mysqli.dll
(The DLLs exist in /ext)
I have confirmed from phpinfo()that loaded configuration file is correct


The paths in php.ini are correct:
C:\PHP
C:\PHP\ext
They are both in the Windows PATH statement

What have I missed?

TIA

B

Fou-Lu
02-19-2010, 08:15 PM
Has the C:/PHP/ext been included in you're system environment path as well?
Also, whenever you make changes you should restart you're service (in this case IIS).

teaorcoffee
02-19-2010, 08:25 PM
Yes, Fou-lu



The paths in php.ini are correct:
C:\PHP
C:\PHP\ext
They are both in the Windows PATH statement



I have rebooted the machine several times also. That should handle the IIS restart :-)

Fou-Lu
02-19-2010, 09:15 PM
Yes, Fou-lu


I have rebooted the machine several times also. That should handle the IIS restart :-)

Sorry, missed that you had added them to the system path.
Yes it should restart the IIS, so no worries there. I'll take a look over at the api to see if there is anything specific to IIS, but in the meantime you should check you're event logs to see if IIS is triggering an error when attempting to load the dll. I had trouble with this way back myself, not because of the system path itself, rather the system path order found an older version of the dll than the version I was trying to use (which PHP did not like. One bit.).


Oh, you know what it is I was thinking of? Not the mysql.dll, but the libmysql.dll. Do you have that one located in a system path?

teaorcoffee
02-19-2010, 09:23 PM
Well, it fixed itself. (?)

I don't understand how, as a number of computer reboots had not fixed this...

But this is what I did:

1. I restarted the mysql service
2. Checked phpinfo() (in IE8) but no change.
3. Thought I'd check in FF3.6 and phpinfo() reported mysql was active and PHPmyAdmin worked!
4. Checked AGAIN in IE8 and this time it worked...

There's no reason why the error presented itself in the first place and IMHO there's no sense in the how it got cured; but I post the result anyway in the hope it may help someone and thank those who have tried to help me.

B

teaorcoffee
02-19-2010, 09:26 PM
Oh, you know what it is I was thinking of? Not the mysql.dll, but the libmysql.dll. Do you have that one located in a system path?


Yes it's there. But see my other post. It's fixed, but the fix was as enigmatic as the problem! :-)

Fou-Lu
02-19-2010, 09:41 PM
Great, that is an oddity.
I can see the phpinfo() itself showing incorrect data if it were cached or anything like that (easiest way is to just make up a query string: phpinfo.php?t=4464kjfasdklj to get an update), but with an attachment to phpmyadmin, I'm not sure why it was struggling.

teaorcoffee
02-19-2010, 09:54 PM
I thought about the cache also. I used my way of dealing with it a lot! (ctrl-F5) :-)

ISTM that with every upgrade of OS/PHP etc. things like this get increasingly difficult! I wonder when there'll be a simple all-in-one installer for IIS/PHP/MySQL along the lines of xampp??? :-)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum