CentOS6.4 yum 升级PHP5.4

php5.4新特性如:

  • Traits支持
  • 内置了一个简单的Web服务器
  • 提供了数组简短语法
  • 直接对函数返回值进行数组取值
  • 最终删除魔术方法及安全模式

首先方案:
1.安装remi 到依赖库
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvi remi-release-5.rpm epel-release-latest-5.noarch.rpm
2.升级php
yum --enablerepo=remi update php* MySQL*
3.验证
php --version

次选方案:安装Webtatic EL6 YUM源
rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm
这里注意,有些搜索结果显示的源地址是http://mirror.webtatic.com/yum/centos/6/latest.rpm,实际上是不正确的。

安装php5.4
yum install php54w php54w-fpm php54w-gd php54w-mbstring php54w-mcrypt php54w-mysql
若安装失败,建议删除之前的版本
yum remove php php-*

注意事项
最新版本中的error_reporting 中E_ALL 现在包含了 E_STRICT,会出现更多的警告及错误提示。默认情况下error_reporting是关闭状态,但是如果是从旧的php版本中升级而来,php.ini可能得不到更新,error_reporting可能开启着。

Leave a Comment Cancel reply

Your email address will not be published.

*

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

1 Trackback