我有 PHP 已弃用的错误淹没日志文件和 Drupal 状态页面,如下所示:
: Function ereg() is deprecated in mysite/includes/file.inc on line 893.
我应该能够在我的 php.ini 中关闭 E_DEPRECATED 错误,但是尽管设置为:
error_reporting = E_ALL & ~E_DEPRECATED
phpInfo() 报告 error_reporting 主值和本地值均为 22527。
我做了一个
grep -R error_reporting
在我的文档根目录中,希望找到任何硬编码的错误级别并且没有运气:
./includes/common.inc: // If the @ error suppression operator was used, error_reporting will have
./includes/common.inc: if (error_reporting() == 0) {
./modules/system/system.module: 'page arguments' => array('system_error_reporting_settings'),
./modules/system/system.admin.inc:function system_error_reporting_settings() {
./modules/system/system.install: $err = error_reporting(0);
./modules/system/system.install: error_reporting($err);
除了 system.install 中的第一行之外,我看不到任何东西是可疑的,但如果我是对的,那应该关闭所有错误。
我没有在 .htaccess 中设置 error_reporting,但这样做也没有任何效果。
我希望有一个解决方案不涉及 common.inc 中的硬编码错误级别(它确实有效,我已经尝试过 - 但显然不受欢迎)。
我知道不推荐使用的错误是升级到 PHP 5.3 的结果,但降级 PHP 不是选项(新站点现在在已在 5.3 上测试过的同一台服务器上运行,并且发生这些错误的站点有 2 个月的寿命)。我也无法升级到与 5.3 配合得很好的 Drupal 版本,因为不幸的是,以前的所有者在没有记录他的更改的情况下破坏了核心模块。
版本的东西:
PHP 5.3.2-1、Ubuntu 10.04、Drupal 6.13 在一个站点上,6.5 (!!1!) 在另一个站点上,Apache 2.2