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 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统