When the new server was found, PHP could not connect to MySQL. Discovered through Phpinfo. The mysqli configuration is not displayed at all. After a series of studies. summed up the next. :
The first step:
There is no mysqli configuration in Phpinfo because there is no configure mysqli when installing PHP7
Install PHP method: wget http://cn2.php.net/distributions/php-7.1.5.tar.gz
Tar zxvf php-7.1.5.tar.gz
CD php-7.1.5
./configure--with-php-config=/usr/local/php/bin/php-config--with-mysqli=/usr/bin/mysql_config
Note:/usr/bin/mysql_config this path for its own mysql_config path can be found by Find-name Mysql_config
Make && make install
CP Php.ini-development/usr/local/lib/php.ini
CP SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP7-FPM
chmod +x/etc/init.d/php7-fpm
Cd/usr/local/php/etc
CP Php-fpm.conf.default php-fpm.conf
CP Php-fpm.d/www.conf.default php-fpm.d/www.conf
/ETC/INIT.D/PHP7-FPM Start PHP
After installation, you'll find Phpinfo has mysqli.
Step Two: Install the mysqli extension
Method:
Cd/usr/local/php-7.1.5/ext/mysqli//To PHP file ext mysqli
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config--with-mysqli=/usr/bin/mysql_config
Note: The Usr/bin/mysql_config path is the same as the first step method
Make
Make Test
Make install
Now there should be a mysqli extension.
Step Three:
Modify PHP.ini
Find the path to php.ini through Phpinfo. Modify the php.ini. Uncomment Php_mysqi.dll
End!
CentOS PHP7 Installation Mysqli expansion experience