CentOS PHP7 Installation Mysqli expansion experience

Source: Internet
Author: User
Tags fpm install php phpinfo

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.