Cannot load MySQL extension or update PHP.INI

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

Cannot load MySQL extension or update PHP.INI

Postby Tad » 28. September 2011 19:18

I have XAMPP 1.7.7 32-bit running on a Windows 7 64-bit system.

My problem is that I cannot get the MySQL extensions loaded, primarily because I can't get a modified PHP.INI loaded.

I installed XAMPP and the services start. However, when I try to go to phpMyAdmin I get a message that the mysql extension is not loaded. Searching the Web says that I need to uncomment the mysql extensions in PHP.INI.

Attempt #1
The file doesn't exist on my system, so I made a copy of php.ini-development that was in the install directories and copied it to C:\Windows, which is the value phpinfo() reports for "Configuration File (php.ini) Path". I stopped and restarted Apache with no effect on the MySQL situation and "Loaded Configuration File" still says none.

Attempt #2
Based upon some comments I found, I moved PHP.INI to C:\xampp\php. I stopped and restarted Apache. Now the admin tool for Apache fails to load properly. It shows only the menus and an exclamation point in the main pane, plus an error message up near the title: "Warning: Variable passed to each() is not an array or object in C:\xampp\htdocs\xampp\head.php on line 27"

This was an unmodified version of the development .ini that shipped.

Attempt #3
I tried the same thing with renaming php.ini-production. The results were the same.

Attempt #4
I ignored these messages and uncommented the MySQL extensions plus set extension_dir to "c:\xampp\php\ext". Stopped and restarted Apache and MySQL, then clicked on phpMyAdmin. I still get the error message that the MySQL extensions are not loaded.

How can I get a PHP.INI file to load properly so that I can turn on the MySQL extension?


Edit to add: If I use that modified PHP.INI file and trick the Apache Administrator module by the following:

1) Rename the PHP.INI file.
2) Start Apache and load the Admin
3) Stop Apache (don't close Admin page), put the .INI file back and restart
4) Hit Status on the Admin.

I see that MySQL now shows as Activated. However, I still can't get to phpMyAdmin.
Last edited by Altrea on 28. September 2011 19:36, edited 1 time in total.
Reason: moved: if you want to post in english, then please use the english part of the board
Posts: 2
Joined: 28. September 2011 18:57

Re: Cannot load MySQL extension or update PHP.INI

Postby Tad » 28. September 2011 19:52

Well, I haven't figured out the problem with loading php.ini files but I did find that copying the phpMyAdmin subdirectory from c:\xampp to c:\htdocs\xampp let me get to the phpMyAdmin page.
Posts: 2
Joined: 28. September 2011 18:57

Re: Cannot load MySQL extension or update PHP.INI

Postby hackattack142 » 28. September 2011 23:16

This seems strange. Are you using the Installer version or the ZIP version?

If you are using the installer version, you might try the ZIP version to make sure you are not missing any files due to the installer doing things it shouldn't. The php.ini file that is loaded should be in "xampp/php". If you do get any errors on pages or logs, it helps if you post those as well.
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
Posts: 703
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 47 guests