Меню

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

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,8303 gold badges29 silver badges27 bronze badges

answered May 31, 2012 at 14:16

c2h5oh's user avatar

c2h5ohc2h5oh

4,3822 gold badges22 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

2562 gold badges4 silver badges12 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,6667 gold badges36 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,0851 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

19k7 gold badges65 silver badges46 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

8419 silver badges15 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

9,99032 gold badges133 silver badges213 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

3332 silver badges14 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

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,8303 gold badges29 silver badges27 bronze badges

answered May 31, 2012 at 14:16

c2h5oh's user avatar

c2h5ohc2h5oh

4,3822 gold badges22 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

2562 gold badges4 silver badges12 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,6667 gold badges36 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,0851 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

19k7 gold badges65 silver badges46 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

8419 silver badges15 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

9,99032 gold badges133 silver badges213 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

3332 silver badges14 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

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,8303 gold badges29 silver badges27 bronze badges

answered May 31, 2012 at 14:16

c2h5oh's user avatar

c2h5ohc2h5oh

4,3822 gold badges22 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

2562 gold badges4 silver badges12 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,6667 gold badges36 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,0851 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

19k7 gold badges65 silver badges46 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

8419 silver badges15 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

9,99032 gold badges133 silver badges213 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

3332 silver badges14 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


Linux, Windows

  • 24.10.2016
  • 3 775
  • 1
  • 25.04.2020
  • 1
  • 1
  • 0

The mysqli extension is missing

  • Содержание статьи
    • Linux
    • Windows
    • Комментарии к статье ( 1 шт )
    • Добавить комментарий

В этой мини статье пойдет речь о том, как быстро исправить ошибку, возникающую при отсутствии нужного модуля для php. Итак, если вы получили вот такое сообщение в phpMyAdmin:

phpMyAdmin — Error
The mysqli extension is missing. Please check your PHP configuration. See our documentation for more information.

mysqli-error

То это скорей всего произошло из-за того, что для php не установлен модуль, отвечающий за работу с mysql.
Решение проблемы:

Linux

Достаточно выполнить данные команды:

sudo apt-get update
sudo apt-get install php-mysql

Windows

Для того, чтобы подключить данный модуль на ОС Windows, необходимо открыть файл конфигурации php.ini и в нем раскомментировать (или добавить в него) строчки:

extension=php_mysqli.dll

После чего перезагрузить веб-сервер.

Я просмотрел все форумы, которые я мог найти по этому вопросу, и моя проблема, но ничего не работает. У меня есть apache2.2 с php5, phpMyAdmin и MySQL. Я раскомментировал расширение, я проверил свой phpinfo() и mysqli не подходит. Мой каталог конфигурации находится там, где он должен быть, и он все равно не загружается.

16 ответы

  1. Узнать какой php.ini используется.
  2. В файле php.ini эта строка:

    extension=mysqli
    
  3. Заменить на:

    extension="C:phpextphp_mysqli.dll"
    
  4. Перезагрузите apache

ответ дан 10 мая ’20, 07:05

Я знаю, что это было давно, но я столкнулся с этим и следил за другими ответами здесь, но безрезультатно, я нашел решение с помощью этого вопроса (Вопрос о переполнении стека)

По сути, просто нужно было отредактировать файл php.ini (мой был найден в c:xamppphpphp.ini) и раскомментировать эти строки…

;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_pdo_mysql.dll

После перезапуска apache все заработало как положено.

ответ дан 23 мая ’17, 11:05

  • В папке Xampp откройте php.ini файл внутри папки PHP, т.е. xamppphpphp.ini (с текстовым редактором).

  • Найдите extension=mysqli (Ctrl+F), если их два, ищем тот, который был раскомментирован (без «;» позади)

  • Измените mysqli с правильным адресом пути, т.е. extension=C:xamppphpextphp_mysqli.dll.

  • На панели управления Xampp остановите и запустите apache и MySQL.

Создан 15 июн.

Если с вашими конфигурационными файлами все в порядке, но проблема остается, установите php7.x-mysql в соответствии с версией установленного php.

Например, в моем случае я использую php7.3, поэтому я выполнил следующую команду, чтобы все настроить:

sudo apt install php7.3-mysql

systemctl reload apache2

ответ дан 12 мар ’21, в 11:03

Эта статья может вам помочь Настройка PHP с MySQL для Apache 2 или IIS в Windows. Посмотрите раздел «Настройка PHP и MySQL под Apache 2», пункт 3:

extension_dir = "c:phpextensions"      ; FOR PHP 4 ONLY 
extension_dir = "c:phpext"             ; FOR PHP 5 ONLY

Вы должны раскомментировать строку параметра extension_dir и указать абсолютный путь к каталогу расширений PHP.

Создан 04 июн.

sudo apt-get install php7.2-mysql

extension=mysqli.so (добавьте этот файл php.ini)

sudo service apahce2 restart

Используйте приведенные выше команды для устранения ошибки отсутствия расширения mysqli.

ответ дан 28 апр.

Скопируйте libmysql.dll из папки установки PHP в папку Windows.

ответ дан 18 мая ’13, 07:05

Я искал часы, и никто не мог мне помочь. Я сделал простую вещь, чтобы решить эту проблему. (ОКНА 10×64)

Следуйте этим:

1 — Перейдите по пути к php_mysqli.dll (в моем случае: C:/xampp/php/ext);

2 — Переместите php_mysqli.dll в предыдущую папку (C:/xampp/php);

3 — Откройте php.ini и найдите строку: «расширение: php_mysqli.dll»;

4 — Измените путь, где находится ваш файл: extension=»C:xamppphpphp_mysqli.dll»;

5 — Перезапустите приложение (wampp, xampp и т. д.) и запустите Apache Server;

Проблема заключалась в пути ext/php_mysqli.dll, я попытался изменить строку на extension=»C:xamppphpextphp_mysqli.dll», но это не сработало.

Создан 01 сен.

Просто укажите каталог, в котором находятся загружаемые расширения (модули), в файле php.ini из

; On windows:
extension_dir="C:xamppphpext"

в

; On windows:
;extension_dir = "ext"

Затем включите расширение, если оно было отключено, изменив

;extension=mysqli

в

extension=mysqli

ответ дан 04 дек ’19, 09:12

У меня была такая же проблема, и я решил ее. Вы также можете решить эту проблему, если выполните следующие действия:

  1. вам нужно установить PHP для С:/php
    или ваша текущая версия найдите его по этому пути и укажите его как системную переменную
  2. затем откройте программу xampp, нажмите «config», откройте php.ini и раскомментируйте следующие строки:

    extension=pdo_mysql
    extension=pdo_mysql
    extension=openssl
    

ответ дан 27 мар ’20, в 21:03

Я столкнулся с этой проблемой сегодня, и в конце концов я понял, что это был комментарий к строке перед dll mysql, которая вызывала проблему.

Это то, что вы должны иметь в php.ini по умолчанию для 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

Помимо удаления точек с запятой, вам также необходимо удалить строку комментария, которая идет после php_exif.dll. Это оставляет вас с

extension=php_exif.dll      
extension=php_mysql.dll
extension=php_mysqli.dll

В моем случае это решает проблему.

ответ дан 27 авг.

Я просто скопировал файл php_myslqli.dll из папки ert обратно в папку php, и он сработал у меня после перезапуска Apache и MySQL из панели управления.

Создан 23 сен.

Это проблема каталога расширений. Вам нужно вручную изменить каталог расширения php, чтобы это работало.

Если вы используете сервер AMPP, выполните следующие действия.

Перейти к настройкам -> PHP -> Конфигурация

найти в php7.3.ini (версии могут измениться)

extension_dir = «» , (уже есть некоторый путь)

и измените значение на

extension_dir = «C:Program FilesAmppsphp-7.3ext»

Если вы используете XAMP

Перейти к настройкам XAMP, Apache -> PHP.ini

Найдите extension_dir = в php.ini и установите путь к папке расширения php на вашем локальном компьютере. См. приведенный ниже пример.

extension_dir = «C:phpext» (Правильно проверьте свой путь)

ответ дан 25 апр.

В моем случае у меня была аналогичная проблема после полной установки Debian 10.

Командная строка:
php -v показать, что я использую php7.4 но распечатать phpinfo() дает мне php7.3

Решение: отключить php7.3, включить 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

ответ дан 16 авг.

Замените

include_path=C:Program Files (x86)xamppphpPEAR

со следующими

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

т.е. добавьте запятые, я проверил журналы ошибок apache, он показывал синтаксическую ошибку, поэтому проверил весь файл на наличие синтаксических ошибок.

ответ дан 20 дек ’20, 22:12

То, что устранило мою проблему: открыть php.ini затем добавьте это extension=php_mysqli.dll

Создан 08 июн.

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками

php
apache
mysqli

or задайте свой вопрос.

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка регистрации ole outlook
  • Ошибка разбора файла сапфир