3
votes

So when I set this directive in php.ini

error_reporting = E_ALL & ~E_DEPRECATED

I still get these errors even after apache reload or reboot.

Thu Sep 13 10:51:10 2012] [error] [client 173.59.22.4] PHP Deprecated: Assigning the return value of new by reference is deprecated in

etc etc etc.

Any ideas? I am not sure why php.ini will not listen to this directive to not list deprecated.

PHP 5.3.3 (cli) (built: Jul 3 2012 16:53:21) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

4
Yeah, not figuring this out at all.Sanity
I think i figured it out, Backupbuddy had an error log setting that was affecting this for some reason. Seems like a bug to me.Sanity

4 Answers

2
votes

This took me ages to debug. Code generated by an old version of phprunner which was crashing because of "Deprecated function mysql_connect. But whatever I did with error_reporting

error_reporting(E_ALL & ~E_DEPRECATED); // was being ignored

It was because the code was using its own error handling function "error handler"

set_error_handler("my_error_handler"); // override error_reporting()

All I had to do was add the following line to function my_error_handler()

if ($errno==8192) return 0;   // ignore Deprecated

I wasted ages fiddling with my php.ini but it had nothing to do with it!

1
votes

error_reporting could've been called somewhere in your script.

you can use this to reset it before the error occurs:

error_reporting(E_ALL & ~E_DEPRECATED);
1
votes

The solution for me was the same as zzapper - the file name for phprunner is phpfunctions.php and this worked:

if ($errno==8192) return 0;   // ignore Deprecated
0
votes

There are several places from which the value of this setting can be changed, including the quite commonly seen ini_set and error_reporting functions. Someone is changing it from one of them.