在centos7.2下升级php版本为7.2.9

1.首先,php -v查看现有的php版本,查询结果

PHP 7.0.29 (cli) (built: Mar 30 2018 08:06:59) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
 

2.更新之前的源文件

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

3.移除系统自带的php-common

yum remove php-common -y 

4.安装php依赖包

yum install -y php72w php72w-opcache php72w-xml php72w-mcrypt php72w-gd php72w-devel php72w-mysql php72w-intl php72w-mbstring

5.重启Apache

/bin/systemctl restart httpd.serviece

你可能感兴趣的:(在centos7.2下升级php版本为7.2.9)