How to enable mysqli using Easyapache 4

Default PHP MSQL extension is deprecated and it will be removed in the future PHP version. Instead of PHP mysql extension, mysqli should be used in the code to avoid PHP compatibility issue.

WHMCS Complete Billing and Support

In EasyApache 3, we can select mysqli extension separately during Apache and PHP compilation using EasyApache 3. But in the latest cPanel version, we have to use EasyApache 4 to enable any PHP extension as EasyApache 3 is no longer available in new cPanel installation.

Enable mysqli using EasyApache 4

EasyApache 4 is now rpm based system and it is easy to use comparing to EasyApache 3.

If mysqli extension is not enabled on your cPanel and if you go to EasyApahce 4, you will notice that there is no separate selection to enable PHP mysqli extension. The reason is, mysqli extension is now provided by the mysqlnd package. That means if you enable mysqlnd package, it should include mysqli extension as well. Also, you can check using command line:

root@[~]# rpm -ql ea-php55-php-mysqlnd
/opt/cpanel/ea-php55/root/etc/php.d/mysqlnd.ini
/opt/cpanel/ea-php55/root/etc/php.d/mysqlnd_mysql.ini
/opt/cpanel/ea-php55/root/etc/php.d/mysqlnd_mysqli.ini
/opt/cpanel/ea-php55/root/etc/php.d/pdo_mysqlnd.ini
/opt/cpanel/ea-php55/root/usr/lib64/php/modules/mysqlnd.so
/opt/cpanel/ea-php55/root/usr/lib64/php/modules/mysqlnd_mysql.so
/opt/cpanel/ea-php55/root/usr/lib64/php/modules/mysqlnd_mysqli.so
/opt/cpanel/ea-php55/root/usr/lib64/php/modules/pdo_mysqlnd.so

As you can see above, if you enable mysqlnd for PHP 5.5, it will also enable mysqli extension for PHP 5.5. If you still receive any error, you will have to make sure that there is no custom php.ini or .htaccess code which is changing your default PHP settings.

Posted in cPanel.

Leave a Reply

Your email address will not be published. Required fields are marked *