"cannot load MySQL extension, please check PHP Configur

Problems with the Windows version of XAMPP, questions, comments, and anything related.

"cannot load MySQL extension, please check PHP Configur

Postby ponomy » 26. November 2008 13:16

I receive the error "cannot load MySQL extension, please check PHP Configuration".

How can I fix this problem.
ponomy
 
Posts: 1
Joined: 26. November 2008 04:22

Re: "cannot load MySQL extension, please check PHP Conf

Postby paintballer4lfe » 27. November 2008 03:58

ponomy wrote:I receive the error "cannot load MySQL extension, please check PHP Configuration".

How can I fix this problem.


go into the logs and look for the error log, open it, and read what it says, that can get you the answer of whats exactly wrong
paintballer4lfe
 
Posts: 11
Joined: 25. November 2008 22:39
Location: Ohio

Re: "cannot load MySQL extension, please check PHP Configur

Postby dmphotography » 09. January 2009 16:25

Ok,
I'm trying to do what I failed to do when I first started trying to make my own server and that's install each part separately. Since this is a learning project for me, I've learned so much by using XAMPP and then adjusting the settings as needed. So I've downloaded and installed Apache, MySQL, PHP5, and still getting stuck on phpMyAdmin.

It gives me the nice red box saying:

phpMyAdmin - Error
Cannot load mysql extension. Please check your PHP configuration.

So I took a look at my php.ini file and there wasn't a single extension one loaded there. No ext folder either. So I downloaded a zip version containing that folder and added it in the php.ini file as needed.
I restarted Apache, still no luck. I took a look at the error log and here's what I get:

Code: Select all
client denied by server configuration: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/phpmyadmin/libraries/

(/phpmyadmin/ is where i installed phpmyadmin at.)

Now I'm not sure what "server configuration" file I need to correct.

** Is this the config.ini.php file?
Now I looked in it and it has this line, which I'd guess is where this error message is coming from:
Code: Select all
$conf['Servers'][$i]['extension'] = 'mysql';


So if I understand this correctly, this is calling on the mysql extension, which should be loaded by the php.ini file, correct? If so, why isn't it making the connection? And the php.ini file does get re-loaded when you restart Apache, even though the PHP5 was installed separate, correct?

***EDIT***
Ok, so I answered my question on the php.ini file and if it gets reloaded when you restart Apache. Yes it does.

I also see that the problem is when I look at my phpinfo(), it isn't showing that it loaded the mysql extension for some reason, because it's not listed there.
I looked at the error log for Apache again and it has a few lines like this
Code: Select all
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\Program Files (x86)\\PHP\\ext\\php_mysql.dll' - The specified module could not be found. \r\n in Unknown on line 0


So then it's telling me that supposedly the php_mysql.dll doesn't exist in that directory path and it does. I verified the path. I don't know what the problem is here.
I copied the "ext" folder to a new directory C:\PHP\ext and changed the extension directory in php.ini and I get the same error, other than it's saying it can't be found in C:\\PHP\\ext\\php_mysql.dll . The file is clearly there. And it's a few others in the folder with it that I have enabled in php.ini it says it cannot find.

I did a test on a computer with XAMPP and I removed the php_mysql.dll, restarted Apache, and it gives the same error with that file missing, so the directory shouldn't be the problem. What am I missing?
Other extensions in that same folder are loading fine, such as php_zip.dll .
The only ones that aren't are php_mcrypt.dll, php_mssql.dll, php_mysql.dll, php_mysqli.dll, php_pdo_mysql.dll, php_pdo_odbc.dll, php_pgsql.dll, php_sqlite.dll. They are all in the same folder as the rest of the extensions.
For great video and written tutorials and guides on creating your own web server and installing things such as forums, blogs, etc., visit http://myownhomeserver.com
dmphotography
 
Posts: 191
Joined: 15. December 2008 14:25
Location: Columbus, MS
Operating System: Windows 7

Re: "cannot load MySQL extension, please check PHP Configur

Postby lawnman » 09. January 2009 18:26

Hello, i have the same problem with "cannot load MySQL extension, please check PHP Configuration" as well as i have not listed mysql variables in phpinfo() like user paintballer4lfe. Wgare could be a problem?
Thanx in advance
lawnman
 
Posts: 1
Joined: 09. January 2009 18:19

Re: "cannot load MySQL extension, please check PHP Configur

Postby dmphotography » 09. January 2009 18:37

lawnman wrote:Hello, i have the same problem with "cannot load MySQL extension, please check PHP Configuration" as well as i have not listed mysql variables in phpinfo() like user paintballer4lfe. Wgare could be a problem?
Thanx in advance


If you're using XAMPP, do a quick search of the forums and you should be able to find the answer, as it's been mentioned several times. I couldn't find mine because I am trying to install the components individually not using XAMPP and I figured there's some really sharp people here that might be able to help even though it's technically a XAMPP support forum.
For great video and written tutorials and guides on creating your own web server and installing things such as forums, blogs, etc., visit http://myownhomeserver.com
dmphotography
 
Posts: 191
Joined: 15. December 2008 14:25
Location: Columbus, MS
Operating System: Windows 7

Re: "cannot load MySQL extension, please check PHP Configur

Postby dmphotography » 09. January 2009 19:00

Ok, I solved my problem partially. The rest I think is going to involve communicating with the whole PHP community on their installation program.

What I concluded is I got this error because of an incompatible version of those files. I don't know how you tell which version they are, but I found out when I was trying to use the installer for PHP, I forgot to include the extension libraries and grabbing the ones from the zip download doesn't work.
So I just re-installed the PHP and this time remembered the extensions and the mySQL extension loads fine now.

Turns out now there's a whole list of other extensions I'm not sure if they're even needed, but I included EVERYTHING when I did the re-install just to be safe.
I imagine most of the ones giving me errors I can simply disable and probably won't ever need either.

But phpMyAdmin works fine now. The only question of concern is it says at the bottom "Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.30. This may cause unpredictable behavior." I'm not quite sure how to correct this, because I don't know which "PHP MySQL library" they're referring to or how to replace it with the newer version.
For great video and written tutorials and guides on creating your own web server and installing things such as forums, blogs, etc., visit http://myownhomeserver.com
dmphotography
 
Posts: 191
Joined: 15. December 2008 14:25
Location: Columbus, MS
Operating System: Windows 7

Re: "cannot load MySQL extension, please check PHP Configur

Postby jhgjkhgl » 13. January 2009 11:10

I had the error, wrong PHP configuration (.ini) file was the problem. Found out from the "phpinfo()" link on the local pages. It was using the .ini file from an old PHP installation I'd forgotten about. Changed its directory name and restarted apache and MySQL, no error.

Thanks Wiedmann.
jhgjkhgl
 
Posts: 1
Joined: 13. January 2009 10:31


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 88 guests