PHP error suppression is being ignored

William Stewart picture William Stewart · Mar 4, 2013 · Viewed 8.8k times · Source

My current php.ini file is set to report all errors other than deprecation and strict standards as follows:

error_reporting = E_ALL & ~E_STRICT & ~E_DEPRECATED

The reason for using this setting is that we urgently need to perform a PHP upgrade on the linux server hosting our websites; the problem there being that deprecated functions and strict standards recommendations will very quickly fill up error log files for over 170 websites. The errors are mostly due to small things like functions not being declared as static, etc. Eventually we will get through all the sites and fix those problems, however in the meantime we need to suppress the errors.

The problem I'm having on a local test environment (running the version of PHP we are looking to upgrade to - 5.4.3) is that the errors still display with the following printed before:

SCREAM: Error suppression ignored for

Can anyone give me some insight into why the error suppression is being ignored and how to properly suppress the errors?

Thanks in advance.

Answer

hek2mgl picture hek2mgl · Mar 4, 2013

It seems that you are using the scream extension. From the manual:

The scream extension gives the possibility to disable the silencing error control operator so all errors are being reported. This feature is controlled by an ini setting.

Scream is an extension for debugging that aims to display as many error messages as possible. This is done by ignoring the @ operator and always having the highest error_reporating level available. (regardless of your error_reporting setting). So you will have to deactivate the extension in your php.ini:

scream.enabled = off

BTW: I would not update a server having 170 websites with code errors. It's a ticking bomb now. It would be better to migrate them site by site to the new PHP version. Maybe having two servers parallel during the migration process.