- MySQLi extension missing phpMyAdmin – Quick fix!
- What is MySQLi extension missing phpMyAdmin error?
- How we fix the MySQLi extension missing phpMyAdmin?
- Enable MySQLi extension in php.ini file
- In Linux
- In windows
- Enable MySQLi using EasyApache4
- Enable MySQLi extension on web-server without any panel.
- Conclusion
- Requires php extension mysqli
- Installation on Linux
- Installation on Windows Systems
- User Contributed Notes
MySQLi extension missing phpMyAdmin – Quick fix!
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:
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 :
3. And, we uncomment the line by removing the hashtag from the beginning, such as:
At last, we restart the webserver.
In windows
1. We open the php.ini file
2 Then we search for the commented line:
3. And, we uncomment the line by removing the hashtag from the beginning, such as:
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.
Requires php extension mysqli
The mysqli extension was introduced with PHP version 5.0.0. The MySQL Native Driver was included in PHP version 5.3.0.
Installation on Linux
The common Unix distributions include binary versions of PHP that can be installed. Although these binary versions are typically built with support for the MySQL extensions, the extension libraries themselves may need to be installed using an additional package. Check the package manager that comes with your chosen distribution for availability.
For example, on Ubuntu the php5-mysql package installs the ext/mysql, ext/mysqli, and pdo_mysql PHP extensions. On CentOS, the php-mysql package also installs these three PHP extensions.
Alternatively, you can compile this extension yourself. Building PHP from source allows you to specify the MySQL extensions you want to use, as well as your choice of client library for each extension.
The MySQL Native Driver is the recommended client library option, as it results in improved performance and gives access to features not available when using the MySQL Client Library. Refer to What is PHP’s MySQL Native Driver? for a brief overview of the advantages of MySQL Native Driver.
The /path/to/mysql_config represents the location of the mysql_config program that comes with MySQL Server.
PHP Version | Default | Configure Options: mysqlnd | Configure Options: libmysqlclient | Changelog |
---|---|---|---|---|
5.4.x and above | mysqlnd | —with-mysqli | —with-mysqli=/path/to/mysql_config | mysqlnd is the default |
5.3.x | libmysqlclient | —with-mysqli=mysqlnd | —with-mysqli=/path/to/mysql_config | mysqlnd is supported |
5.0.x, 5.1.x, 5.2.x | libmysqlclient | Not Available | —with-mysqli=/path/to/mysql_config | mysqlnd is not supported |
Note that it is possible to freely mix MySQL extensions and client libraries. For example, it is possible to enable the MySQL extension to use the MySQL Client Library (libmysqlclient), while configuring the mysqli extension to use the MySQL Native Driver. However, all permutations of extension and client library are possible.
Installation on Windows Systems
On Windows, php_mysqli.dll DLL must be enabled in php.ini .
As with enabling any PHP extension (such as php_mysqli.dll ), the PHP directive extension_dir should be set to the directory where the PHP extensions are located. See also the Manual Windows Installation Instructions. An example extension_dir value is c:\php\ext .
Note:
If when starting the web server an error similar to the following occurs: «Unable to load dynamic library ‘./php_mysqli.dll'» , this is because php_mysqli.dll cannot be found by the system.