我尝试在使用official php-fpm图片的Docker容器中运行Yii based PHP application。为什么在写入标准输出时,PHP-FPM为前缀写入警告?
码头集装箱将所有日志消息写入到stdout
/stderr
是很常见的做法。所以,我做同样的从我的容器,它看起来像这样的代码:
$fp = @fopen('php://stdout','w');
fwrite($fp, $message);
fclose($fp);
不幸的是PHP-FPM现在前缀与丑陋的警告,我所有的日志消息:
[3月21日-2016 14:10:02]警告:[pool www] child 12表示输入stdout:“2016-03-21 14:10:02 [xxxx] [ - ] [ - ] [trace] [yii \ base \ Application :: bootstrap ]引导与yii \调试\模块::引导()“ [21-Mar-2016 14:10:02]警告:[池www]儿童12说入标准输出:”2016-03-21 14:10:02 [xxxx] [ - ] [ - ] [info] [yii \ web \ Session :: open] Session started“ ...
这是为什么,有没有办法阻止PHP-FPM做到这一点?
UPDATE:
- 我也在docker-library/php项目网站正式开通an issue。
- 他们已经在their configuration中包含
catch_workers_output = yes
。所以这不是解决方案。
我认为这是一个常见的错误https://github.com/heroku/heroku-buildpack-php/issues/63它已在44版中修复,您能否确认? –
@HalayemAnis无法确认。正如你应该从问题描述中看到的,我不使用heroku。这更多的是一般的php-fpm的不当行为。 –
您尝试使用'php.ini'中的'catch_workers_output'选项?不知道这是否会起作用。 – Pitchinnate