CentOS yum安装php5.6

CentOS使用yum安装php时,默认的版本偏低为5.3.3。像laravel这样的框架就没办法安装,为此找了一下升级的办法。

1. 删除原来的php

不删除的情况下yum会提示php相关组件已安装。

yum remove php*

2. 安装php 5.6

参考链接:http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-centos.html#php-support

yum -y update
yum -y install epel-release
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget https://centos6.iuscommunity.org/ius-release.rpm
rpm -Uvh ius-release*.rpm
yum -y update
yum -y install php56u php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel php56u-mysql php56u-intl php56u-mbstring php56u-bcmath

3. 查看php版本并重启服务

php --version

service httpd restart