Home > Backend Development > PHP Tutorial > Linux, centos upgrade php version to the latest

Linux, centos upgrade php version to the latest

不言
Release: 2023-03-22 22:40:02
Original
8618 people have browsed it

This article shares with you the method of upgrading PHP version to the latest version on Linux and CentOS. Friends in need can refer to it.

Before updating PHP, first check the current PHP version to avoid duplication. Update

# php -v

Check the current PHP installation package

# yum list installed | grep php

Remove the current PHP installation package , otherwise it is easy to cause conflicts

# yum remove php*

Since the default YUM source cannot upgrade PHP, a third-party YUM source needs to be added, and webtatic is used here.

Because it is CentOS 6.5, use the following URL # rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

If it is CentOS 7.x

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

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

Check the available PHP installation packages on the YUM source

# yum list php*

Install PHP5.5 and required extensions

# yum install php55w php55w-devel php55w-common php55w-mysql php55w-pdo php55w-opacache php55w-xml

Check the PHP version again to confirm whether the installation is successful

By the way, if your If PHP uses Redis, please don’t forget to install the php-redis extension

# yum install php-redis



If it appears at the end that it cannot be compiled, refer to https://www.cnblogs.com/likui360/p/5511909.html

Related recommendations:

Centos7 Upgrade PHP version to php7 instance sharing

The process and precautions for upgrading PHP to 5.3.3 under windows

The above is the detailed content of Linux, centos upgrade php version to the latest. 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