Home  >  Article  >  Backend Development  >  How to upgrade php on centos

How to upgrade php on centos

藏色散人
藏色散人Original
2019-11-11 10:28:544073browse

How to upgrade php on centos

How to upgrade php in centos?

Centos7 Upgrade the php version to php7

1. First check if there is an old version

yum list installed | grep php

Recommended: "PHP Tutorial

2. If installed

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. After cleaning the old version, upgrade it

1. Since the yum source of Linux does not exist for php7. x, so we need to change the yum source:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

How to upgrade php on centos

2. Check whether there is php7.x in the yum source

yum search php7

See the picture below, which proves that php has been Exist in the yum source

How to upgrade php on centos

3. yum installs php72w and various extensions, just choose what you need:

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

How to upgrade php on centos

Installation completed

4. Check the php version

php -v

How to upgrade php on centos

The above is the detailed content of How to upgrade php 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