How to enable MySQLi extension on web-server

It’s a MySQL extension for PHP programming language,Today I’ll explain How we can enable MySQLi on a cPanel server and How we can check if MySQLi is enabled or not in server.

How to check the MySQLi extension is enabled or not on server?

You can check the MySQLi extension is enabled or not from command line itself by executing the below command.

php -m | grep mysql

How to enable MySQLi extension on web-server with cPanel?

We can easily enable the MySQLi extension by re-building the web-server with easyapache . It really is easy, just run the below commands from the command line as a root user, and choose the MySQLi from the extensions.

mysqli

How to enable MySQLi extension on web-server without cPanel?

In a server without cPanel, you need to compile the MySQL with the MySQLi extension.

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

Now you can check if MySQLi extension is successfully enabled on server:

php -m|grep mysql
mysql
mysqli

That’s all.