Yosemite/Mamp Pro/CodeIgniter错误

Sal*_*oui 11 php codeigniter mamp-pro

在我安装Yosemite之后,我从bitbucket克隆了我的repo,并使用Mamp pro设置了自定义域名.

我发现这个错误:

Severity: Notice

Message: Only variable references should be returned by reference

Filename: core/Common.php

Line Number: 257
Run Code Online (Sandbox Code Playgroud)

和另一个错误:

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at
/site/system/core/Exceptions.php:185)

Filename: libraries/Session.php

Line Number: 675
Run Code Online (Sandbox Code Playgroud)

我环顾四周,但将envvars文件重命名为__envvars的修复程序对我不起作用.顺便说一下,在Mamp/Library/bin文件夹中我必须有文件1:envvars 2:envvars-std

我该如何解决这个错误?

谢谢

小智 37

在CodeIgniter 2.X中使用PHP> = 5.6时出现此问题

你可以通过降级你的PHP版本<= 5.5来解决它

或者在CodeIgniter中更改此行,如下所示:/site/system/core/Common.php行号257

改变这一行

return $_config[0] =& $config;
Run Code Online (Sandbox Code Playgroud)

$_config[0] =& $config;
return $_config[0];
Run Code Online (Sandbox Code Playgroud)


小智 0

您升级到 Yosemite 的同时是否更新了 MAMP Pro?我问这个问题是因为今天早些时候更新 MAMP Pro(更新至 v3.0.7.2)后我开始收到此错误...

也就是说,我注意到默认的 PHP 版本已经上升到 5.6.2,所以我将其设置回 5.5.18,在 Apache 重新启动后,一切又恢复正常。