Ошибка расширение mysqli для php не установлено

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.

Dharman's user avatar

Dharman

30.5k22 gold badges85 silver badges133 bronze badges

asked May 18, 2012 at 4:18

Wesley's user avatar

5

  1. Find out which php.ini is used.
  2. In file php.ini this line:

    extension=mysqli
    
  3. Replace by:

    extension="C:phpextphp_mysqli.dll"
    
  4. Restart apache

Your Common Sense's user avatar

answered Aug 31, 2018 at 21:07

AAGREDA's user avatar

AAGREDAAAGREDA

2312 silver badges2 bronze badges

2

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

answered May 20, 2020 at 22:02

faye.babacar78's user avatar

2

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:xamppphpphp.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.

Community's user avatar

answered Jul 1, 2013 at 21:11

sradforth's user avatar

sradforthsradforth

2,1762 gold badges23 silver badges37 bronze badges

  • In your Xampp folder, open php.ini file inside the PHP folder i.e xamppphpphp.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:xamppphpextphp_mysqli.dll.

  • On your Xampp control panel, stop and start apache and MySQL

Sonu Sourav's user avatar

Sonu Sourav

2,8262 gold badges12 silver badges25 bronze badges

answered Jun 14, 2020 at 3:00

Adedoyin Adetunji's user avatar

1

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

answered Apr 27, 2020 at 16:34

Sundar's user avatar

SundarSundar

2532 silver badges6 bronze badges

1

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:phpextensions"      ; FOR PHP 4 ONLY 
extension_dir = "c:phpext"             ; FOR PHP 5 ONLY

You must uncomment extension_dir param line and set it to absolute path to the PHP extensions directory.

answered Jun 4, 2012 at 14:13

Dmytro Zarezenko's user avatar

Dmytro ZarezenkoDmytro Zarezenko

10.5k11 gold badges62 silver badges104 bronze badges

Simply specify the directory in which the loadable extensions (modules) reside in the php.ini file from

; On windows:
extension_dir="C:xamppphpext"

to

; On windows:
;extension_dir = "ext"

Then enable the extension if it was disabled by changing

;extension=mysqli

to

extension=mysqli

answered Dec 4, 2019 at 9:57

SamWanekeya's user avatar

SamWanekeyaSamWanekeya

5465 silver badges10 bronze badges

1

Copy libmysql.dll from the PHP installation folder to the windows folder.

answered May 18, 2013 at 6:28

RM.'s user avatar

RM.RM.

1,97619 silver badges29 bronze badges

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:xamppphpphp_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:xamppphpextphp_mysqli.dll» but doesn’t worked.

answered Sep 1, 2019 at 4:37

Spawn's user avatar

SpawnSpawn

585 bronze badges

0

I had the same problem and I solved it. You can solve it too if you follow these steps:

  1. you have to install PHP to C:/php
    or your current version locate it to this path and specify it as a system variable
  2. then open xampp program and click config and open php.ini
    and uncomment the following lines:

    extension=pdo_mysql
    extension=pdo_mysql
    extension=openssl
    

Dharman's user avatar

Dharman

30.5k22 gold badges85 silver badges133 bronze badges

answered Mar 27, 2020 at 20:54

Mohammed AL MahmoOd's user avatar

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

answered Sep 19, 2022 at 10:55

Hassan Elshazly Eida's user avatar

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.

answered Aug 27, 2014 at 5:53

Vinci Chow's user avatar

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

answered Sep 23, 2019 at 14:23

Ocheng Jerome Jesse's user avatar

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 FilesAmppsphp-7.3ext»

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:phpext» (Check your path properly)

answered Apr 25, 2020 at 3:47

user3230982's user avatar

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

answered Aug 16, 2020 at 22:39

ShapCyber's user avatar

ShapCyberShapCyber

3,3422 gold badges20 silver badges27 bronze badges

Replace

include_path=C:Program Files (x86)xamppphpPEAR

with following

include_path="C:Program Files (x86)xamppphpPEAR"

i.e Add commas , i checked apache error logs it was showing syntax error so checked whole file for syntax errors.

answered Dec 20, 2020 at 22:36

Waleed Mohsin's user avatar

Waleed MohsinWaleed Mohsin

1,0931 gold badge10 silver badges13 bronze badges

The thing that fixed my problem is: open php.ini then add this extension=php_mysqli.dll

Dharman's user avatar

Dharman

30.5k22 gold badges85 silver badges133 bronze badges

answered Jun 8, 2021 at 8:20

Cyrille Con Morales's user avatar

I have a problem with phpmyadmin on ubuntu 12.04.
I have already installed apache2, php5, mysql and phpmyadmin.

The phpinfo(); script, don’t show nothing about mysqli or mysql extension.

When I try start phpmyadmin this error appear:

----
**phpMyAdmin - Error**
-------
**The mysqli extension is missing. Please check your PHP configuration.**
----

In the php.ini file, I uncommented extension=mysql.so line, but doesn’t work…

Anyone have another posible solution?

asked May 26, 2012 at 19:30

Jeremas's user avatar

9

Latest phpMyAdmin versions require mysqli extension and will no longer work with mysql one (note the extra «i» at the end of its name).

For PHP 7.3

sudo apt-get install php7.3-mysqli

For PHP 8

sudo apt-get install php8.0-mysqli

Will install package containing both old one and the new one, so afterwards all you need to do is to add

extension=mysqli.so

in your php.ini, under the subject Dynamic Extensions.

Restart apache:

sudo systemctl restart apache2

Authenticate if needed and press enter.

Should be done! If problem still occurs remove the browser cache.

Timo's user avatar

Timo

2,8823 gold badges29 silver badges27 bronze badges

answered May 31, 2012 at 14:16

c2h5oh's user avatar

c2h5ohc2h5oh

4,4522 gold badges23 silver badges30 bronze badges

5

sudo apt-get install php5-mysql
sudo apt-get install php5-mysqlnd 

try both of alternatively it works for me

answered Apr 4, 2014 at 13:36

Hardik Gajjar's user avatar

6

If you run PHPMyAdmin on localhost uncomment in file /etc/php5/apache2/php.ini this line:

mysqli.allow_local_infile = On

Restart Apache:

sudo /etc/init.d/apache2 restart

answered Sep 11, 2012 at 17:48

Nilson Dimas's user avatar

2

Just restart the apache2 and mysql:

  • apache2: sudo /etc/init.d/apache2 restart

  • mysql: sudo /etc/init.d/mysql restart

then refresh your browser, enjoy phpmyadmin :)

Jost's user avatar

Jost

1,53912 silver badges18 bronze badges

answered Sep 26, 2013 at 7:16

dendi's user avatar

dendidendi

1131 silver badge1 bronze badge

3

I tried a lot of the answers and none of them seemed to work because php7.0 is not the default.

sudo apt-get upgrade

seemed to do the job for me but I had to reinstall php7.0 and phpmyadmin after that:

sudo apt-get install php7.0 php7.0-mysql
sudo apt-get install apache2 apache2-mod-php7.0
sudo apt-get install phpmyadmin

Hope it helps!

answered Oct 7, 2017 at 23:48

Maanit's user avatar

MaanitMaanit

3062 gold badges4 silver badges13 bronze badges

1

I faced same issue and resolved it by doing following steps:

  1. First check PHP versions. If you have multiple PHP Versions. Suppose you have PHP versions like php7.0, php7.1 and php 7.2 then

  2. run these commands

For PHP7.0

sudo apt-get install php7.0-mysql
sudo apt-get install php7.0-mysqlnd 

For PHP7.1

sudo apt-get install php7.1-mysql
sudo apt-get install php7.1-mysqlnd 

For PHP7.2

sudo apt-get install php7.2-mysql
sudo apt-get install php7.2-mysqlnd 

For PHP7.3

sudo apt-get install php7.3-mysql
sudo apt-get install php7.3-mysqlnd
  1. Edit the ini file and look for mysqli. Uncomment the line by removing ;
    for all php versions

    extension=mysqli.so

/etc/php/<php.version>/apache2/php.ini

For PHP7.0

sudo nano /etc/php/7.0/apache2/php.ini

For PHP7.1

sudo nano /etc/php/7.1/apache2/php.ini

For PHP7.2

sudo nano /etc/php/7.2/apache2/php.ini

For PHP7.3

sudo nano /etc/php/7.3/apache2/php.ini

and last restart apache server

sudo /etc/init.d/apache2 restart

Zegert's user avatar

answered Jan 8, 2020 at 7:37

Gufran Hasan's user avatar

Gufran HasanGufran Hasan

8,8427 gold badges37 silver badges50 bronze badges

1

I solved this problem by editing /usr/local/zend/etc/php.ini.

(found it by doing netstat -nlp ¦ grep apache, then strace -p somepid ¦ grep php.ini).

At the end of the file, I added:

extension=/usr/lib/php5/20090626+lfs/mysql.so
extension=/usr/lib/php5/20090626+lfs/mysqli.so
extension=/usr/lib/php5/20090626+lfs/mcrypt.so

Adding it without the path did not work.

Then after a restart it worked.

answered Feb 26, 2013 at 21:27

Shimbawa's user avatar

ShimbawaShimbawa

2623 silver badges12 bronze badges

For ubuntu user open your terminal and type following command

sudo apt-get install mysql

After that just restart apache2 by typing this

sudo service apache2 restart 

refresh you browser and enjoy phhmyadmin

answered Jan 15, 2019 at 13:15

Risheekant Vishwakarma's user avatar

For Ubuntu 20.04 users with php-fpm
I fixed the issue by adding the full path in the php conf:

edit /etc/php/7.4/fpm/conf.d/20-mysqli.ini

and replace

extension=mysqli.so

with:

extension=/usr/lib/php/20190902/mysqli.so

answered May 11, 2020 at 11:13

Giuseppe's user avatar

GiuseppeGiuseppe

2,0831 gold badge21 silver badges26 bronze badges

1

Checking the extension_dir is one of the thing you like to check from phpinfo().In my case it was extension_dir = «./» by default which was wrong. Change it to extension_dir = ‘./ext/’ or where all your extension dlls are currently residing.

answered Apr 13, 2013 at 13:56

kta's user avatar

ktakta

19.3k7 gold badges65 silver badges47 bronze badges

Just add this line to your php.ini if you are using XAMPP etc. also check if it is already there just remove ; from front of it

extension= php_mysqli.dll

and stop and start apache and MySQL it will work.

answered Apr 18, 2019 at 10:10

Imad Ullah's user avatar

Imad UllahImad Ullah

8999 silver badges16 bronze badges

You need the MySQLi module. This error usually occurs when manually installing phpMyAdmin.

sudo apt-get install php7.3-mysql

It will return you with.

[Creating config file /etc/php/7.3/mods-available/mysqlnd.ini with new version]

[Creating config file /etc/php/7.3/mods-available/mysqli.ini with new version]

Then.

sudo service apache2 restart.

Then.

Press F5 on your browser.

answered Jan 21, 2020 at 3:10

MasterCassidy's user avatar

This worked for me , make a database with a php and mysql script and open up the mysql console and type in create user ‘yourName’@’127.0.0.1’ and then type in grant all privileges on . to ‘yourName’@’127.0.0.1’ then open up a browser go to localhost and a database should been made and then go to your phpmyadmin page and you will see it pop up there.

Echilon's user avatar

Echilon

10k32 gold badges131 silver badges216 bronze badges

answered Dec 11, 2012 at 20:21

june1992's user avatar

june1992june1992

1512 silver badges10 bronze badges

at ubuntu 12.04 i had to change mssql.compatability_mode = On.
put On and works

Tamil Selvan C's user avatar

answered Jun 10, 2014 at 17:26

Robson de Jesus's user avatar

1

Since I had this problem following an upgrade, I just disable Apache2-php5

a2dismod php5

and activated php7

a2enmod php7

Hope it may help anybody!

answered Mar 26, 2019 at 12:08

Golgot's user avatar

GolgotGolgot

3582 silver badges15 bronze badges

I have encountered the same error on ubuntu and what worked for me was editing 2 lines in /etc/php/7.3/apache2/php.ini

  ;extension=mysqli to   extension=mysqli

and gave the extension variable location to mysqli.so after uncommenting it

   extension=/usr/lib/php/20170718/mysqli.so

then restart the service just to make sure

systemctl start mysql

answered Feb 5, 2020 at 15:30

Mike Araya's user avatar

Mike ArayaMike Araya

1551 silver badge11 bronze badges

For the record, my system is Ubuntu Server 20.04 and none of the solutions here worked. For me, I installed PHP 7.4 and I had to edit enter code here/etc/php/7.4/apache2/php.ini`.

Within this, search for ;extension=mysqli, uncomment and change mysqli to mysqlnd so it should look like this extension=mysqlnd. I tried using mysqli but I faced the same error as if I didn’t enable it but mysqlnd worked for me.

answered May 7, 2020 at 13:34

SergeantSerk's user avatar

Had the very same problem, but in my case the reason was update of Ubuntu and php version — from 18.04 and php-7.2 up to 20.04 and php-7.4.

The Nginx server was the same, so in my /etc/nginx/sites-available/default was old data:

server {
  location /pma {
    location ~ ^/pma/(.+.php)$ {
      fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    }
  }
}

I could not get phpmyadmin to work with any of php.ini changes and all answers from this thread, but at some moment I had opened the /etc/nginx/sites-available/default and realised, that I still had old version of php. So I just changed it to

fastcgi_pass unix:/run/php/php7.4-fpm.sock;

and the issue was gone, phpmyadmin magically started to work without any mysqli-file complaint. I even double checked it, but yeap, that’s how it works — if you have wrong version for php-fpm.sock in your nginx config file, your phpmyadmin will not work, but the shown reason will be ‘The mysqli extension is missing’

answered Oct 29, 2020 at 9:41

Green Joffer's user avatar

I hope my successful answer helps someone in recent times as I had to try many mix-and-matches and then found it:

This solution worked for me on Ubuntu 20.04 Desktop with PHP v7.4, PHP v8.0.7 and MySQL v8.0.25 setup.

What I did was edited /etc/php/7.4/apache2/php.ini and /etc/php/8.0/apache2/php.ini files and replaced
extension=mysqli.so
with
extension=/usr/lib/php/20190902/mysqli.so
in both the files.

Later, restarted both of these (PHP and MySQL) by sudo systemctl restart apache2 and sudo systemctl restart mysql. Refreshed Chrome, and phpMyAdmin responded with the login screen.

(UPDATE: Please check if you have /usr/lib/php/20200930/mysqli.so file as well. I tested this as it looked newer by directory date, and this too worked in both the PHP files as extension=/usr/lib/php/20200930/mysqli.so)

answered Jun 25, 2021 at 14:16

Avinash's user avatar

Are you receiving MySQLi extension missing error in phpMyAdmin? Here’s how we fix it.

Usually, this error happens when MySQLi extension is not enabled in the php.ini file.

At Bobcares, we often receive requests to fix MySQLi extension missing errors as part of our Server Management Services.

Today, let’s analyze the error and see how our Support Engineers fix it for our customers.

What is MySQLi extension missing phpMyAdmin error?

Before getting deeper into the error, firstly, let’s understand what is MySQLi extension missing in phpMyAdmin?

The MySQLi functions allow us to access MySQL database servers and it’s a relational database driver used in the PHP scripting language. If the MySQLi extension is present we get this error.

A sample error at PHPMyAdmin will look like

How we fix the MySQLi extension missing phpMyAdmin?

So far, we have seen what is MySQLi extension missing in phpMyAdmin error. The solution for this error is to enable the MySQLi extension on the server.

Let’s see the different ways our Support Engineers fix this error for our customers by enabling MySQLi extension.

Enable MySQLi extension in php.ini file

First, we verify that the extension in PHP modules is enabled or not. For this, we run this command:

php -m | grep -i mysqli

Let us discuss how our Support Engineers enable the MySQLi extension from the php.ini file in Linux and Windows.

In Linux

1. First, we open the php.ini file (/etc/php/php.ini)

2. Then we search for the commented line :

#extension=php_mysqli.so

3. And, we uncomment the line by removing the hashtag from the beginning, such as:

extension=php_mysqli.so

At last, we restart the webserver.

In windows

1. We open the php.ini file

2 Then we search for the commented line:

#extension=php_mysqli.dll

3. And, we uncomment the line by removing the hashtag from the beginning, such as:

extension=php_mysqli.dll

Thus enabling it resolved the error.

Enable MySQLi using EasyApache4

The simplest way to enable MySQLi is from EasyApache. Let us discuss how our Support Engineers enable it from EasyApache.

1. First, we login to the WHM as root.

2. Then we search for “EasyApache4” or go to Software > EasyApache4

3. At the top look for “Currently Installed Packages” and we click on the button “Customize”

4. Then on the left panel section, we click on “PHP Extensions”

5. After this, we search for mysqlnd.

6. We see something like “php70-php-mysqlnd” (depend on the PHP versions). We enable it.

7. Click on Review and and click on Provision button.

Enable MySQLi extension on web-server without any panel.

Our Support Engineers also provide a solution for the customers who are not using any panels. To enable MySQLi extension in the server without panel. We run the below command such as

# ./configure --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config

Then after, we check the MySQLi extension is enabled on the server.

Conclusion

In short, The error is mainly due to the missing of MySQLi extension in the php.ini file. Today we saw how our Support Engineers resolve the error MySQLi extension missing on PHPMyAdmin and the different ways to enable the MySQLi extension.

Hi @MESWEB

PHP7 delete mysqli extension. Now phpMyAdmin should use PDO.

mysql but not mysqli (https://www.php.net/manual/en/mysql.php)

«Depending on the version of PHP, there are either two or three PHP APIs for accessing the MySQL database. PHP 5 users can choose between the deprecated mysql extension, mysqli, or PDO_MySQL. PHP 7 removes the mysql extension, leaving only the latter two options.»

We could use PDO but that would require a lot of work.

Did you follow #15236 (comment) to install the Debian version ?

Anyway, you need mysqli. There is no alternatives :)

The actual problem starts with the display of a phpMyAdmin demo page. With reference to that problem you need to re-install the LAMP in your local Ubuntu.

Although it looks a little bit difficult, in actual case, it’s easy.

Let’s solve the first problem.

Lamp server phpMyAdmin is showing demo page

First, we need to remove the LAMP altogether.

Issue this command one after another:

sudo apt-get remove --purge *mysql*
sudo apt-get autoremove
sudo apt-get autoclean
rm -rf /etc/mysql /var/lib/mysql
sudo apt-get remove phpmyadmin
sudo apt-get remove apache2

Next, we need to install every package fresh:

sudo apt-get install php7.0 apache2 mysql-server mysql-client phpmyadmin

Remember, we have installed php7.0. Therefore, our next step will be to set the php.ini file.

Now you can check the PHP info in your localhost.

php-info-page

PHP info page on localhost

However, when we try to open the phpMyAdmin page on localhost, it gives us the error: “MySQLi extension is missing please check PHP configuration”.

How to solve MySQLi extension is missing error?

phpmyadmin-error

phpMyAdmin gives this error

This part is little tricky, although not very difficult.

First, we need to install PHP 7.0 mysqli extension, and then we need to add it in our respective php.ini file.

Issue the following command to install PHP 7.0 mysqli extension.

sudo apt-get install php7.0-mysqli

Next, you need to open the respective php.ini file and under the Dynamic Extension, add:

extension=mysqli.so

After that restart Apache.

sudo systemctl restart apache2

Now, it’s all set. We can open the phpMyAdmin without any problem.

phpMyAdmin Page on localhost

phpMyAdmin Page on localhost

What Next?

Books at Leanpub
Books in Apress
My books at Amazon
GitHub repository
Technical blog
Twitter

  • Ошибка расчета хеша для файла консультант
  • Ошибка рассматривается как следствие объединяющее все те случаи
  • Ошибка расчета стоимости доставки через сдэк
  • Ошибка рассеянного 10 букв сканворд
  • Ошибка расчета стоимости доставки через почту россии