How to install mysql extension in centos php

藏色散人
Release: 2020-10-19 11:53:20
Original
3626 people have browsed it

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
Copy after login

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

extension=mysql.so
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template