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

How to install php extension on centos

王林
Release: 2020-09-03 15:14:57
Original
3129 people have browsed it

How to install php extension on centos

Specific method:

(Recommended tutorial: php video tutorial)

1. Check the currently installed PHP package

yum list installed | grep php
Copy after login

2. If there are installed PHP packages, delete them first

yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64
Copy after login

3. Configure the yum source of CentOS 7.0

yum install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Copy after login

4. Use the yum list command to view available Installed package (Packege)

yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
Copy after login

5. Install PHP5.6.x

yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof
Copy after login

6. Check the installed PHP version.

php --version
Copy after login

7. Install php-fpm

yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm
Copy after login

(Related recommendations: php training)

8. Restart Apache and php services

$ sudo systemctl restart httpd
$ sudo systemctl restart php-fpm
Copy after login

The above is the detailed content of How to install php extension on centos. 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