PHP error suppression is being ignored

荒凉一梦 提交于 2019-12-23 13:38:09

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/15203168/php-error-suppression-is-being-ignored

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!