2016-07-06 117 views
3

我已经四处寻找这个主题,但所有与在centOS上升级php相关的问题似乎都相当过时。我发现https://www.zerostopbits.com/how-to-upgrade-php-5-3-to-php-5-6-on-centos-6-7/ 它看起来相当简单;但是,我不熟悉安装新的回购。在CentOS 6.7上从php 5.5.x升级到5.6.x

似乎有相当数量的回购,有我需要的PHP 5.6包,但我不确定哪些将被认为是最好的或最安全的。

此外,有什么不兼容我应该知道,因为CentOS不提供最新版本?

回答

4

这是为我工作的最简单的方法:要在CentOS 6或7的安装PHP 5.6:

的CentOS 6中显示的顺序输入以下命令:

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 

CentOS 7.按所示顺序输入以下命令:

yum -y update 
yum -y install epel-release 
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 
wget https://centos7.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 

查看如何升级到PHP 7以及更多: http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-centos.html

+0

没有为CentOS 6工作 – realplay

+0

@realplay什么是错误信息? –