CodeIgniter 2.X 于 PHP5.6 兼容错误

本篇文章由:http://xinpure.com/codeigniter-2-x-to-php5-6-compatible-error/php

CI 3.0 已兼容此问题服务器

在代码迁移的过程当中,遇到了一个 PHP 版本兼容错误codeigniter

A PHP Error was encountered

Severity: Notice

Message: Only variable references should be returned by reference

Filename: core/Common.php

Line Number: 257

原服务器 PHP 版本为 5.4,新服务器 PHP 版本为 5.6, Codeigniter 版本 2.1.3code

解决方法网上比较多,在这记录下,作个笔记。get

主要缘由: 此错误主要出如今 Codeigniter 2.x 使用 PHP 5.6 以上的版本it

解决方法: class

  1. 降级 PHP 版本到 5.5 如下方法

  2. 修改 /system/core/Common.php 第257行代码error

将:兼容

return $_config[0] =& $config;

改为:

$_config[0] =& $config; return $_config[0];
相关文章
相关标签/搜索