dongshangan2074 2013-10-25 12:36
浏览 66
已采纳

如何配置PHP以在运行时忽略error_reporting()?

I am running an application which is riddled with error_reporting calls, but I'm running PHP 5.5 which has a lot of depreciated warnings. I have configured my php.ini file correctly like this.

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

But all of the error_reporting() calls override it. Is there any way I configire to ignore runtime calls to error_reporting()?

Changing all the error_reporting() calls is a real hassle, especially as the application will need to be regularly updated and I want to avoid running a post install hack script.

I don't want to mention the name of the app, it's VBulletin 5.

  • 写回答

2条回答 默认 最新

  • dongmeng2687 2013-10-25 12:52
    关注

    There is an ini-setting disable_functions, which you could use to disable the error_reporting() function. That way the application can not set the error reporting level via this function.

    disable_functions = error_reporting
    

    Only internal functions can be disabled using this directive. User-defined functions are unaffected. This directive must be set in php.ini For example, you cannot set this in httpd.conf.

    See: http://www.php.net/manual/en/ini.core.php#ini.disable-functions

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。
  • ¥20 CST怎么把天线放在座椅环境中并仿真
  • ¥15 任务A:大数据平台搭建(容器环境)怎么做呢?
  • ¥15 r语言神经网络自变量重要性分析
  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型