I have looked through all of the forums that I could find relevant to this question and my problem yet nothing works. I have apache2.2 with php5, phpMyAdmin, and MySQL. I have uncommented the extension, I have checked my phpinfo()
and mysqli does not come up. My config directory is where it should be and it still will not load.
-
1Have you restarted apache? In order for changes in the php.ini to be taken into effect, apache needs to be restarted. Also, try php -m from the commandline. – Chris Henry May 18 '12 at 04:50
-
What does Sql Server has to do with this? – madth3 May 18 '12 at 05:11
-
Yeah I have restarted apache, and tried your php -m in the commandline. Nothing has worked yet. – Wesley May 18 '12 at 18:01
-
I was facing the same issue when i update my php version from 5.6 to 7 and the solution i had to do is try to check my httpd-xampp config file. Make sure the Php-Module conform with your current php version. example here: IfModule php5_module Based on my migration i was using php7, so edit all the php5_module tag in my config file to php7_module and restart the apache server. – Abdallah Abdillah Jun 26 '18 at 17:31
-
2As for the error message: "The mysqli extension is missing. Please check your PHP configuration. [See our ***documentation for more information***](https://phpmyadmin.readthedocs.io/en/latest/faq.html#i-receive-an-error-about-missing-mysqli-and-mysql-extensions)." - See also [Dude, where's my php.ini? (server config)](//stackoverflow.com/q/8684609) and restart PHP-FPM and/or webserver procceses after editing the right one. – mario Jun 28 '19 at 02:06
17 Answers
- Find out which php.ini is used.
In file php.ini this line:
extension=mysqli
Replace by:
extension="C:\php\ext\php_mysqli.dll"
- Restart apache

- 156,878
- 40
- 214
- 345

- 241
- 2
- 2
-
4Ok, worked for me. But setting an absolute path as the value to extension_dir (i.e., extension_dir = "c:\php\ext") seems to be a more elegant solution. – vitrums Apr 17 '19 at 21:55
-
Replace include_path=C:\Program Files (x86)\xampp\php\PEAR with include_path="C:\Program Files (x86)\xampp\php\PEAR" – Waleed Mohsin Dec 20 '20 at 22:37
If your configuration files are okay but still having the same issue then install php7.x-mysql according to the version of the installed php.
For example in my case, I'm using php7.3 so I ran the following command to get it all set:
sudo apt install php7.3-mysql
systemctl reload apache2

- 774
- 7
- 12
I know this is a while ago but I encountered this and followed the other answers here but to no avail, I found the solution via this question (Stackoverflow Question)
Essentially just needed to edit the php.ini file (mine was found at c:\xampp\php\php.ini) and uncomment these lines...
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_pdo_mysql.dll
After restarting apache all was working as expected.
In your Xampp folder, open
php.ini
file inside the PHP folder i.exampp\php\php.ini
(with a text editor).Search for
extension=mysqli
(Ctrl+F), if there are two, look for the one that has been uncommented (without ";" behind)Change the mysqli with the correct path address i.e
extension=C:\xampp\php\ext\php_mysqli.dll
.On your Xampp control panel, stop and start apache and MySQL

- 2,926
- 2
- 12
- 25

- 61
- 1
- 2
-
Also, make sure you have uncommented this ```;extension_dir = "ext"``` line, because until then your extensions won't be found by the apache. To uncomment this just remove the semicolon (;) from the beginning like this ```extension_dir = "ext"``` and you are good to go. – Jaydeep Goswami Jun 07 '22 at 12:21
sudo apt-get install php7.2-mysql
extension=mysqli.so (add this php.ini file)
sudo service apahce2 restart
Please use above commands to resolve mysqli-extension missing error

- 253
- 2
- 6
This article can help you Configuring PHP with MySQL for Apache 2 or IIS in Windows. Look at the section "Configure PHP and MySQL under Apache 2", point 3:
extension_dir = "c:\php\extensions" ; FOR PHP 4 ONLY
extension_dir = "c:\php\ext" ; FOR PHP 5 ONLY
You must uncomment extension_dir param line and set it to absolute path to the PHP extensions directory.

- 10,526
- 11
- 62
- 104
Simply specify the directory in which the loadable extensions (modules) reside in the php.ini file from
; On windows:
extension_dir="C:\xampp\php\ext"
to
; On windows:
;extension_dir = "ext"
Then enable the extension if it was disabled by changing
;extension=mysqli
to
extension=mysqli

- 546
- 5
- 10
-
Solved my issue by adding 'extension=mysqli' to my php.ini file. Becuase I'm using MAC. – Lalarukh khan Mar 17 '23 at 14:39
I've been searching for hours and no one could help me. I did a simple thing to solve this problem. (WINDOWS 10 x64)
Follow this:
1 - Go to your php_mysqli.dll path (in my case: C:/xampp/php/ext);
2 - Move the php_mysqli.dll to the previous folder (C:/xampp/php);
3 - Open php.ini and search the line: "extension: php_mysqli.dll";
4 - Change to the path where is your file: extension="C:\xampp\php\php_mysqli.dll";
5 - Restart your application (wampp, xampp, etc.) and start Apache Server;
The problem was the path ext/php_mysqli.dll, I've tried changing the line to extension="C:\xampp\php\ext\php_mysqli.dll" but doesn't worked.

- 58
- 5
I had the same problem and I solved it. You can solve it too if you follow these steps:
- you have to install PHP to C:/php or your current version locate it to this path and specify it as a system variable
then open xampp program and click config and open php.ini and uncomment the following lines:
extension=pdo_mysql extension=pdo_mysql extension=openssl

- 30,962
- 25
- 85
- 135

- 91
- 1
- 8
try to change PHP version
$sudo update-alternatives --config php
if it didn't work change for example from PHP 5.6 => PHP 7.1
$ sudo a2dismod php5.6
$ sudo a2enmod php7.1
$ sudo service apache2 restart

- 605
- 5
- 20
I encountered this problem today and eventually I realize it was the comment on the line before the mysql dll's that was causing the problem.
This is what you should have in php.ini by default for PHP 5.5.16:
;extension=php_exif.dll Must be after mbstring as it depends on it
;extension=php_mysql.dll
;extension=php_mysqli.dll
Besides removing the semi-colons, you also need to delete the line of comment that came after php_exif.dll. This leaves you with
extension=php_exif.dll
extension=php_mysql.dll
extension=php_mysqli.dll
This solves the problem in my case.
I simply copied my php_myslqli.dll file from ert folder back to php folder, and it worked for me after restarting my Apache and MySQL from the control Panel
Its an issue of extension directory. You need to change php extension directory manually to work this.
If you are using AMPP Server, do the following
Goto settings -> PHP -> Configuration
in php7.3.ini Find, (Versions might change)
extension_dir = "" , (Already having some path)
and change value to
extension_dir = "C:\Program Files\Ampps\php-7.3\ext"
If you are using XAMP
Goto XAMP Settings, Apache -> PHP.ini
Find, extension_dir = in php.ini, and set path of the php extension folder of your local machine. See the below example.
extension_dir = "C:\php\ext" (Check your path properly)

- 21
- 2
In my case, I had a similar issue after full installation of Debian 10.
Commandline:
php -v
show I am using php7.4
but print phpinfo()
gives me php7.3
Solution: Disable php7.3 Enable php7.4
$ a2dismod php7.3
$ a2enmod php7.4
$ update-alternatives --set php /usr/bin/php7.4
$ update-alternatives --set phar /usr/bin/phar7.4
$ update-alternatives --set phar.phar /usr/bin/phar.phar7.4
$ update-alternatives --set phpize /usr/bin/phpize7.4
$ update-alternatives --set php-config /usr/bin/php-config7.4

- 3,382
- 2
- 21
- 27
Replace
include_path=C:\Program Files (x86)\xampp\php\PEAR
with following
include_path="C:\Program Files (x86)\xampp\php\PEAR"
i.e Add commas , i checked apache error logs it was showing syntax error so checked whole file for syntax errors.

- 1,103
- 1
- 10
- 13
The thing that fixed my problem is: open php.ini
then add this extension=php_mysqli.dll

- 30,962
- 25
- 85
- 135

- 918
- 1
- 6
- 21