Topic: php56-php-fpm STDOUT to proper stdout, not /dev/null

Hello,

By default php56-php-fpm /proc/pid/fd looks like this:

# ls -l /proc/1/fd
total 0
lrwx------. 1 root root 64 May 22 11:39 0 -> /dev/null
lrwx------. 1 root root 64 May 22 11:39 1 -> /dev/null
l-wx------. 1 root root 64 May 22 11:39 2 -> /opt/remi/php56/root/var/log/php-fpm/error.log
# etc..

Also:

# ls -l /dev/stdout
lrwxrwxrwx 1 root root 15 May 18 09:33 /dev/stdout -> /proc/self/fd/1

Is there any way to change the target of stdout (and stderr) to go to the regular STDOUT and STDERR?

We're running this on Centos7 docker image, and like all other containerised apps, we would want to have all logs go to proper STDOUT/ERR, not /dev/null or logfile.

I've found only some hacky dbg way of changeing it on the fly but that is no good.

Re: php56-php-fpm STDOUT to proper stdout, not /dev/null

Nothing wrong with default behavior which match FastCGI standard.

See comments in pool configuration, with explanation how to change this.

; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
;catch_workers_output = yes
Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: php56-php-fpm STDOUT to proper stdout, not /dev/null

Just if anyone happens to stumble to this problem:

Our configs first included the *.d configs which overwrote the log config to /dev/stdout, after that we had the generic rules which put it back to that file.

The ordering was wrong. We put the includes last (as they should be) and then everything started working. Logs now write to stdout/container's log.