问题原文
原帖链接 · Fabio · CC BY-SA 3.0
I've a setup with nginx + php-fpm. I found in my nginx error log a lot of PHP Warning messages like this:
2016/03/17 20:57:23 [error] 23002#0: *114868 FastCGI sent in stderr: "PHP message: PHP Warning: Declaration of Walker_Category_Filter::start_el(&$output, $category, $depth, $args) should be compatible with Walker_Category::start_el(&$output, $category, $depth = 0, $args = Array, $id = 0) in /var/www/wp-content/themes/venture/functions/theme/custom-post-types.php on line 0
PHP message: PHP Warning: Parameter 1 to W3_Plugin_TotalCache::ob_callback() expected to be a reference, value given in /var/www/wp-includes/functions.php on line 3464", client: 52.69.241.233, server: www.myhost.net, request: "GET /appuntamenti/ HTTP/1.1", host: "www.myhost.net"
I don't want to log event like this, they fill up my logs and create a lot of rumors on New Relic reports. Do you knwow ho to change this behavior of nginx?
I've tried to change my php.ini configuration with this:
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
The event are logged in nginx error log, so I think that's not related to php-fpm configuration.
Any suggestion is welcome
Thanks Fabio
已采纳解答
原帖链接 · Xiong Chiamiov · CC BY-SA 3.0
Those are warnings generated by PHP itself; since they're printed to stdout (or maybe stderr) without being caught, they end up in your server logs.
I would expect that entry in your php.ini to be sufficient to silence those warnings. If that is not happening, you should check to see if the application overrides those settings through the error_reporting() function.
In general, you should pay attention to warnings - they are warnings after all! Whoever is responsible for maintaining the application (that might be you) should look into them and fix them; silencing them in your logs is just papering over the issues, and may come back to bite you in the ass.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
