How to enable MySQLi extension on web-server
Before going directly to the enabling steps I will give you some ideas about MySQLi. Then, 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.
What is MySQLi?
Simply it’s a MySQL extension for PHP programming language. The MySQLi Extension (MySQL Improved) is a relational database driver used in the PHP programming language to provide an interface with MySQL databases. The developers of the PHP programming language recommend using MySQLi when dealing with MySQL server versions 4.1.3 and newer (takes advantage of new functionality). The MySQLi extension has a lot of benefits, some of them are listed below:
>> An object-oriented interface
>> Support for prepared statements
>> Support for multiple statements
>> Support for transactions
>> Enhanced debugging support
>> Embedded server support
>> Powerful Functionality
How to check the MySQLi extension is enabled or not on server?
You can check the MySQLi extension from command line itself by executing the following command.
# php -m | grep mysql
how to enable MySQLi extension on web-server with cPanel?
We can simply enable the MySQLi extension by rebuilding the web-server with easyapache script. It is very simple, just run the below pasted scripts from the command line as root user, and select the MySQLi from the extension list. See the attached image for more details:
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
How to check the MySQLi extension is enabled on server?
# php -m|grep mysql mysql mysqli
That’s it 🙂