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

How to install php extension on centos

王林
王林Original
2020-09-03 15:14:573075browse

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

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

3. Configure the yum source of CentOS 7.0

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

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

yum list --enablerepo=remi --enablerepo=remi-php56 | grep php

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

6. Check the installed PHP version.

php --version

7. Install php-fpm

yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm

(Related recommendations: php training)

8. Restart Apache and php services

$ sudo systemctl restart httpd
$ sudo systemctl restart php-fpm

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!

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