How to install MySQLi on MacOS
MySQLi is part of PHP. There should be a php-mysqli type package available, or you can take the PHP source and recompile that mysqli enabled. You may already have it installed, but it's done as a module and is disabled. Check your php.ini for extension=mysqli.so
or similar. it may be commented out, or the .so file is present in your extensions directory but not linked to PHP via that extension= directive.
This article is clearly explained, how to install MySqli with EachApache. This works for me too.
To install mysqli using EachApache:
Login to WHM as 'root' user.
Either search for "EasyApache" or go to Software > EasyApache
Scroll down and select a build option (Previously Saved Config)
Click Start "Start customizing based on profile"
Select the version of Apache and click "Next Step".
Select the version of PHP and click "Next Step".
Chose additional options within the "Short Options List"
Select "Exhaustive Options List" and look for "MySQL Improved extension"
Click "Save and Build"
This is how I installed it on my Debian based machine (ubuntu):
php 7:
sudo apt-get install php7.0-mysqli
php 5:
sudo apt-get install php5-mysqli
Use php-mysqlnd
instead of php-mysql
. On Linux, to install with apt-get
type:
apt-get install php-mysqlnd