Home  >  Article  >  Backend Development  >  How to install php7 with yum under Centos?

How to install php7 with yum under Centos?

一个新手
一个新手Original
2018-05-18 11:30:588581browse

How to install php7 with yum under Centos?

How to install php7 under yum in Centos?

1. Installation source

To install php7, you need to configure additional yum source address, otherwise an error will be reported and the relevant software package cannot be found.

How to install php7 with yum under Centos?

##phpThe source address of the higher version of yum has two parts, one of which is epel- release, and the other part comes from webtatic. If epel-release is skipped, an error will pop up when installing webtatic.

How to install php7 with yum under Centos?

So, the command required here is:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Of course, you can also choose the following command, which will have the same effect.

yum install epel-release -y
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

2. Clear historical versions

In order to prevent

php conflicts from happening on centos, so this command should be done first It would be better to implement it.

yum -y remove php*

3. Install php7 and various extensions

In fact, there are many corresponding extension libraries here, everyone must pay attention here

cli These two packages are and fpm, and other related packages depend on your needs.

yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel
There is also a more luxurious version:

yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml

4. After the installation is completed, start the service

systemctl enable php-fpm.service
systemctl start php-fpm.service

5. The installation is successful

For more related knowledge, please visit

PHP Chinese website! !

The above is the detailed content of How to install php7 with yum under 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