Centos php升级php7

1. 检查当前安装的PHP包

yum list installed | grep php

2. 完全移除当前PHP安装包以免起冲突

yum remove php*

3.查看当前yum源都提供了哪些可安装的PHP版本

yum list php*

注意:默认的yum源无法升级PHP,需要添加第三方yum源,我们选择webtatic库

CentOs 5.x
rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm
CentOs 6.x
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
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

4.安装PHP及相关插件,这里以PHP7.1.x为例

yum install php71w php71w-cli php71w-common php71w-devel php71w-embedded php71w-fpm php71w-gd php71w-mbstring php71w-mysqlnd php71w-opcache php71w-pdo php71w-xml php71w-ldap php71w-mcrypt php71w-bcmath

 5.查看PHP版本

php -v

欢迎访问本网站!
雨木霜月 » Centos php升级php7

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据