wamp cannot load mysqli extension

54,509

Solution 1

I deleted the PHP in program files ad everything started working , the problem that there two installations of pHp

Solution 2

I tried many solutions, and none worked for me. I tried the following solutions:

  • Restart wampserver
  • Reinstall wampserver
  • restart machine
  • and all other solutions mentioned in this question.

However, none of these worked. Then I found that my PHPMyAdmin was not working in chrome and was working in firefox. So I tried clearing cache, restarting browser etc, but still it would not work.

Then I deleted all the files from C:\wamp\tmp and then tried again, and it works. I am not sure why it works, but here is what I think. The session was cached and not getting cleared. So as soon as I deleted all files in this directory all the sessions were deleted and hence it worked fine.

Solution 3

First, make sure that the php.ini file is loading the mysqli extension.
If you are using WAMPServer, click on the icon in the system tray, go to PHP -> PHP Extensions and make sure it is checked. If not, go into the php.ini file and make sure that the line: extension=php_mysqli.dll is uncommented (eg, remove the ; if it exists). If that line does not exist, add it.

If this still does not work, double check that the right php.ini file is being loaded.
To do so, view your phpinfo() (Here for WAMPServer). Scroll down to the Loaded Configuration File row and see which php.ini is being loaded.Make sure it is the right file. If you're using WAMPServer, it should be(WAMP INSTALL FOLDER)\bin\apache\Apache2.2.11\bin\php.ini. By default, it isC:\wamp\bin\apache\Apache2.2.11\bin\php.ini`.

If a different php.ini file is being loaded, just rename it to something else so that PHP will try and find the file somewhere else. There should be a way to specify which on eyou want to use, but I forget exactly how to do that...

If this still doesn't work... Try messing around with phpMyAdmin's settings, or using another answer, but I'm afraid I can't help beyond this.

Solution 4

I was running WAMP with two PHP versions 1) 5.2.9 and 2) 5.2.13.

As per site requirement i needed to change PHP version to 5.2.9 from 5.2.13. after swapping PHP version, error was "mysqli extension is missing". after debugging long time i get to know it was due to wrong "extension_dir" path in php.ini file.

So i changed its value:

Old: "extension_dir" c:/wamp/bin/php/php5.2.13/ext/

New: "extension_dir" c:/wamp/bin/php/php5.2.9/ext/

Restarted All services in wamp server, then it's fixed.

Solution 5

Also setup the mysql password:

SET PASSWORD FOR root@localhost=PASSWORD('your_password');

And the phpmyadmin mysql password in config.inc.php:

$cfg['Servers'][$i]['password'] = 'your_password';
Share:
54,509
localhost
Author by

localhost

Updated on July 23, 2020

Comments

  • localhost
    localhost almost 4 years

    WAMP installed fine, no problems, BUT...

    When going to phpMyAdmin, I get the error from phpMyAdmin as follows:

    Cannot load mysqli extension. Please check your PHP configuration
    

    Also, phpMyAdmin documentation explains this error message as follows:

    To connect to a MySQL server, PHP needs a set of MySQL functions called "MySQL extension". This extension may be part of the PHP distribution (compiled-in), otherwise it needs to be loaded dynamically. Its name is probably mysql.so or php_mysql.dll. phpMyAdmin tried to load the extension but failed. Usually, the problem is solved by installing a software package called "PHP-MySQL" or something similar.

    Finally, the apache_error.log file has the following PHP warnings (see the mySQL warning):

    PHP Warning: Zend Optimizer does not support this version of PHP - please upgrade to the latest version of Zend Optimizer in Unknown on line 0
    PHP Warning: Zend Platform does not support this version of PHP - please upgrade to the latest version of Zend Platform in Unknown on line 0
    PHP Warning: Zend Debug Server does not support this version of PHP - please upgrade to the latest version of Zend Debug Server in Unknown on line 0
    PHP Warning: gd wrapper does not support this version of PHP - please upgrade to the latest version of gd wrapper in Unknown on line 0
    PHP Warning: java wrapper does not support this version of PHP - please upgrade to the latest version of java wrapper in Unknown on line 0
    PHP Warning: mysql wrapper does not support this version of PHP - please upgrade to the latest version of mysql wrapper in Unknown on line 0
    

    So, for some reason PHP is not recognizing the mysql extension.

    Anyone know why? Any solution or workaround?

  • peterorum
    peterorum over 14 years
    Me, too. You can check on phpinfo() which php.ini is being loaded.
  • ericso
    ericso over 11 years
    I had another install of PHP with Apache 2.2. I uninstalled PHP via the Programs and Features control panel AND deleted the PHP folders I found in the C: root directory and Program Files.
  • Adam
    Adam over 10 years
    Same for me, delete the phpinfo file :)