Req #71880 [Com]: Optionally disable warnings when writing to STDOUT

From: Date: Thu, 25 Aug 2016 16:42:47 +0000
Subject: Req #71880 [Com]: Optionally disable warnings when writing to STDOUT
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203547@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71880&edit=1

 ID:                 71880
 Comment by:         mark dot sagikazar at gmail dot com
 Reported by:        haertl dot mike at gmail dot com
 Summary:            Optionally disable warnings when writing to STDOUT
 Status:             Open
 Type:               Feature/Change Request
 Package:            FPM related
 Operating System:   Linux
 PHP Version:        5.6.19
 Block user comment: N
 Private report:     N

 New Comment:

What's the advantage of using a named pipe instead of a file? The log file should be lost with
the restart of the container anyway.


Previous Comments:
------------------------------------------------------------------------
[2016-07-06 11:01:30] inefedor at gmail dot com

Just as a quick solution without the need for grepping/sedding you could use named pipes:

mkfifo /tmp/stdout

In docker CMD you'd write something along the lines of

CMD service start && tail -f /tmp/stdout

And in PHP you would need to write to /tmp/stdout, this way you won't have to use file system
to store the output.

------------------------------------------------------------------------
[2016-07-06 09:28:49] copong at gmail dot com

Definitely an issue when running fpm on containers, only way we've found around this that
doesn't involve tailing a log file is to pipe fpm's output through sed, which is hacky.

------------------------------------------------------------------------
[2016-03-22 14:29:04] haertl dot mike at gmail dot com

Description:
------------
When you write to STDOUT PHP-FPM creates a warning.

This is a problem when you want to run PHP-FPM in a docker container. It's common pratice for
docker containers to write any log output to STDOUT/STDERR.

If you do this with e.g. with the official php-fpm docker image, you'll end up with tons of
ugly warnings like above. Right now there's no way to get rid of these warnings. It will also
split up a single multi-line output into several distinct warnings.


Related issue at docker:
https://github.com/docker-library/php/issues/207



Test script:
---------------
$fp = @fopen('php://stdout','w');
fwrite($fp, "my output string...");

Expected result:
----------------
There should be an ini-Setting to turn off these warnings.

Actual result:
--------------
WARNING: [pool www] child 12 said into stdout: "my output string..."


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=71880&edit=1


Thread (16 messages)

« previous php.bugs (#203547) next »