Home >Operation and Maintenance >CentOS >How to install mysql extension in centos php

How to install mysql extension in centos php

藏色散人
藏色散人Original
2020-10-19 11:53:203695browse

How to install the mysql extension in centos php: first download the mysql extension package; then find and open the php.ini configuration file; then add the extension package with the statement "extension=mysql.so"; finally restart php-fpm Just serve.

How to install mysql extension in centos php

Recommended: "centos Getting Started Tutorial"

CentOS Install the mysql extension under PHP7

The mysql extension has been officially removed from PHP7. If the system db needs to operate the database in mysql mode, we can install it manually (it is recommended to use PDO operation) Database)

1. Download the mysql expansion package

git clone https://github.com/php/pecl-database-mysql     mysql   --recursive
cd mysql
phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install

2. Add the expansion package to vim /etc/php.ini

extension=mysql.so

Save and restart the php-fpm service

php -m Check it out

The above is the detailed content of How to install mysql extension in centos php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn