11

After i installed Yosemite, i cloned my repo from bitbucket and i setup custom domain with Mamp pro.

I hove this error:

Severity: Notice

Message: Only variable references should be returned by reference

Filename: core/Common.php

Line Number: 257

and another Error :

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

i looked around but the fix to rename the envvars file to __envvars doesn't work for me. By the way in the Mamp/Library/bin folder i have to files 1: envvars 2: envvars-std

How can i resolve this errors ?

Thanks

Salmen Bejaoui
  • 865
  • 1
  • 8
  • 22
  • possible duplicate of [Only variable references should be returned by reference - Codeigniter](http://stackoverflow.com/questions/28348879/only-variable-references-should-be-returned-by-reference-codeigniter) – Suresh Kamrushi May 20 '15 at 06:20

3 Answers3

37

This issue in CodeIgniter 2.X when use it with PHP >=5.6

you can solve it by downgrade your PHP version <= 5.5

or change this line in CodeIgniter as following File: /site/system/core/Common.php Line number 257

change this line from

return $_config[0] =& $config;

to

$_config[0] =& $config;
return $_config[0];
Mhisham
  • 564
  • 4
  • 9
3

codeigniter 2.2 fixes the issue you can update frameowrk folder in order to fi this

Manual Fix

Filename: core/Common.php Line Number: 257

BEFORE CHANGE:

return $_config[0] =& $config; 

AFTER CHANGE:

$_config[0] =& $config;
return $_config[0]; 
0

Did you update MAMP Pro at the same time as your upgrade to Yosemite? I ask because it was by updating MAMP Pro earlier today (to v3.0.7.2) that I started getting this error...

That said, I noticed that the default PHP version had gone up to 5.6.2 so I set it back down at 5.5.18 and after Apache had restarted all was working fine again.

Murfur
  • 1
  • 1