How to enable mysqli on XAMPP?

By seeing suggestions throughout the Internet I tried to convert all my queries to mysqli.

But mysqli is not working in my XAMPP. I checked my PHP folder and there is a php_mysqli.dll file… still it doesn’t work

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Have you declare it to php.ini to load it? If no, try find this in php.ini and add php_mysqli.dll

; Dynamic Extensions ;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;   extension=modulename.extension
; For example, on Windows:
;   extension=msql.dll
; ... or under UNIX:
; ... or with a path:
;   extension=/path/to/extension/
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.

extension= php_mysqli.dll

Solution 2

Goto the directory phpMyAdmin, find there is a file with name, open the file and find a line there as:
$cfg['Servers'][$i]['extension'] = 'mysql';
just change mysql to mysqli.

Solution 3

Another thing that might be blocking the msqli dll from loading could be user right issues on your local webserver, make sure the \User can read the ext folder, that was what worked for me

Solution 4

I think you should use XAMPP 1.8.3-1, XAMPP 1.8.2-2, XAMPP 1.8.1.
Because these xampp versions also support Mysqli by default.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply