Home > Backend Development > PHP Problem > How to upgrade php on centos

How to upgrade php on centos

藏色散人
Release: 2023-02-28 13:22:02
Original
4115 people have browsed it

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

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

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

How to upgrade php on centos

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

yum search php7
Copy after login

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

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!

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