Home > Article > Backend Development > Linux, centos upgrade php version to the latest
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!