我已经用nginx + php-fpm设置了。 我在我的nginx错误日志中发现了很多这样的PHP警告消息:
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"
我不想logging这样的事件,他们填写我的日志,并在New Relic报告中创造大量的传言。 你是否想改变nginx的这种行为?
我试图改变我的php.iniconfiguration:
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
事件logging在nginx错误日志中,所以我认为这与php-fpmconfiguration无关。
任何build议是值得欢迎的
感谢法比奥
那些是由PHP本身产生的警告; 因为他们被打印到标准输出(或者也许stderr)而不被捕获,他们最终在你的服务器日志。
我期望在你的php.ini中input足以使这些警告消失。 如果没有发生,你应该检查应用程序是否通过error_reporting()函数覆盖这些设置。
一般来说,你应该注意警告 – 毕竟他们是警告! 无论谁负责维护应用程序(可能是你),都应该研究并修复它们; 在你的日志中沉默它们只是在讨论问题,并可能会回来咬你的屁股。
虽然熊的答案为你工作,我不得不使用下面的方法。
在编辑PHP.ini文件并确保没有ini_set / error_reporting值并重新启动php5-fpm服务后,我仍然收到警告出现在最后我不得不将这添加到我的fpm池文件
/etc/php5/fpm/pool.d/www.conf
closures警告:
php_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
然后重启服务
service php5-fpm restart