A few web applications has been returning this “Assigning the return value of new by reference is Deprecated” message after I’ve upgraded my local web server to run PHP 5.3. Don’t be surprise if your CakePHP 1.2 app suddenly shows this message. The fact lies in that php 5.3 included a few changes and some scripts are not written to be php 5.3 compatible yet.
Here’s a tip for CakePHP 1.2 developers, in order to get rid of that annoying message from your app, you can edit cake/libs/configure.php so that the line
error_reporting(E_ALL)
now reads
error_reporting(E_ALL & ~E_DEPRECATED)
Alternatively, you can also download the new CakePHP 1.3 Dev package as compatibility changes have been added for PHP 5.3. If you decide to do that, consider that there are changes from 1.2 to 1.3 as well and you might need some time getting your app running properly in 1.3 (for more info 1.2 to 1.3 migration guide)
Er says
Nice tip!
Was about to go crazy 😀
Tdscheyfacese says
Hi,
iam using php 5.3 and cake 1.3-dev, but still getting deprecated errors. Not so much as before, but still a bunge. I couldnt fine any information, i am close to freak out.
would nice if you could give me some hints.
thank you.
David says
Although I’ve tried php 5.3 with cakephp 1.3 dev as well, personally I am and would still recommend using cakephp 1.2 with php 5.2. I would suggest testing your code locally http://www.davidtan.org/test-before-you-migrate-upgrade-to-php-5-3/ before going into production with 5.3