Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Cannot load mysqli extension. Please check your PHP configuration...I'm lost...

Posted on 2008-10-15
Medium Priority
Last Modified: 2013-12-13
I just sent up WAMP and when I go to phpMyAdmin, I get this error message: Cannot load mysqli extension. Please check your PHP configuration. I've seen a couple of different possible solutions and I wanted to get some direction before I started popping the hood and pulling wires.
Question by:brucegust
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Author Comment

ID: 22727834
I'm running IIS on port 1080 and it's working great. WAMP is functioning fine, as far as I can tell in that the "localhost" comes up fine etc. But phpMyAdmin doesn't even blink. I know this isn't a new problem because I've seen a number of threads, but thus far nothing has helped including removing the ";" from the extension directory in the php.ini file.

Is there some ninja out there who can make my life a little better by solving this quandary?
LVL 29

Expert Comment

ID: 22728417
As stated at page,
<<PHP 5+
MySQL is no longer enabled by default, so the php_mysql.dll DLL must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying libmysql.dll to the Windows system directory also works (because the system directory is by default in the system's PATH), it's not recommended.

As with enabling any PHP extension (such as php_mysql.dll), the PHP directive extension_dir should be set to the directory where the PHP extensions are located. See also the Manual Windows Installation Instructions. An example extension_dir value for PHP 5 is c:\php\ext

Note: If when starting the web server an error similar to the following occurs: "Unable to load dynamic library './php_mysql.dll'", this is because php_mysql.dll and/or libmysql.dll cannot be found by the system.
So you need to:
-uncomment the line in php.ini [you probably did... but beware: there are several php.ini in various directories, the trick is to find the rtelevant one!]
- check that php_mysql.dll and/or libmysql.dll are at the correct place
- RESTART Apache (I often forget this one!)

On my own machine (your mileage may vary):
- in C:\xampp\php, file php.ini has around line 627
- around line 640
BUT note that your probably don't need PDO AND that there is an issue with PDO, you might need to change this dll.

Once everything is OK and apache restarted, look at your phpinfo from your XAMPP html page at http://localhost/

Author Comment

ID: 22737254
OK, I think we're making progress, or at least I understand the logic behind the problem I'm having.

First off, as far as the path is concerned, I have this under my Environment Variables:

C:\Program Files\PHP\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\

When I go to C:\ProgramFiles\PHP\, the only file that is there php.ini. That seemed like a possible cause for concern if the system is looking there for libmysql.dll

The directory where libmysql.dll is located is C:\wamp\bin\php\php5.2.6\. Do I need to change anything in my Environment Variables? As an experiment, I did swap the seemingly incorrect address out with the accurate one, but it didn't seem to make a difference. Also, under on my phpinfo page, I have as the _SERVER["PATH"] the same address (C:\Program Files\PHP\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\) and I didn't know if that was something else that needed to be changed.

I checked for the correct location of my extension_dir and that's good to go.

As far as my list of extensions, here's what they look like on my php.ini file (I just copyed and pasted the revevant ones):


I don't know how to restart Apache, but other than that, I'm thinking it's the path that's the problem. Yet, I'm not sure what to change. Do I change the ini file or just my Environment Variables or do I change anything at all?


LVL 29

Accepted Solution

fibo earned 2000 total points
ID: 22743409
1 - A usual trap is that there are several php.ini on the machine! And not sure which one is the one selected!
2 - c:\programs\php is NOT the directory where your XAMP php runs from... it is presumably C:\wamp\bin\php\php5.2.6\
I would suggest that you look for a php.ini there and, if there is one, then check that the mods you meant to make... are done. (rename c:\programs\php\php.ini to php.ini-old)
3 - to stop / start Apache: look at the *.bat files ic c:\wamp
If you stop and restart you computer, apache will relaunch.

Author Comment

ID: 22749249
Renamed the old php.ini file, changed the PATH like you suggested then restarted the computer which is something I hadn't done last time and now we're running along beautifully.

Now I just to learn php and MySql...


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question