大网数据广告活动
服务器运维问答

How can I stop Apache2 from log certain warning messages?

· 52CE 我爱测

On my Apache ErrorLog file I see many times this warning message: [Wed Aug 23 17:27:25.146025 2017] [:error] [pid 14989] [client 66.249.76.54:44935] PHP Warning: Illegal offset type in isset or empty in /var/www/html/blog/wp-cont…

问题原文

原帖链接 · NineCattoRules · CC BY-SA 3.0

On my Apache ErrorLog file I see many times this warning message:

[Wed Aug 23 17:27:25.146025 2017] [:error] [pid 14989] [client 66.249.76.54:44935] PHP Warning:  Illegal offset type in isset or empty in /var/www/html/blog/wp-content/plugins/ilab-media-tools/classes/tools/s3/ilab-media-s3-tool.php on line 1012

I tried on Github to ask help from author (as many others) but nothing.

Apache print this warning every minute, is there a way to filter this annoying message warning?

已采纳解答

原帖链接 · HBruijn · CC BY-SA 3.0

Adjust the level of error_reporting in your php.ini file to the desired level to prevent the messages from getting generated in the first place, if you can't/won't fix the actual code that is triggering such messages.

By default everything except run-time notices get logged:

 error_reporting = E_ALL & ~E_NOTICE 

but maybe all you want are the fatal run-time errors:

 error_reporting = E_ERROR & E_CORE_ERROR 

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-08-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。