Friday, May 7, 2010

stop php deprecated warnings in browser

I just installed newest version of wamp server on a new windows 7 machine. When I installed the web app, I got a bunch of following printouts in the browser at the top of every webpage:
Deprecated: Assigning the return value of new by reference is deprecated in [...]\cake\libs\inflector.php on line xxx

After spending an hour looking, here is what worked:

1. in cake/lib/object.php: add following in next line after <&ques;php
error_reporting(E_ALL ^ E_DEPRECATED);

2. in cake/libs/configure.php replace
error_reporting(E_ALL ^ E_DEPRECATED);

3. in your php.ini, search for error_reporting and replace the entire line with
error_reporting = E_ALL & ~E_DEPRECATED