-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to send php errors to std #811
Comments
TL;DR use So The When detached The redirect chain: $ docker run -dit --rm --name php php:7.2-fpm-alpine
fc3a3751c6e37a1518ce1b692e25cf81869ed1d9e98fd6a7635007306d93f75f
$ docker exec -it php sh
# ls -al /dev/ | grep std
lrwxrwxrwx 1 root root 15 Apr 8 21:42 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Apr 8 21:42 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Apr 8 21:42 stdout -> /proc/self/fd/1
# ls -al /proc/self/fd
lrwx------ 1 root root 64 Apr 8 21:44 0 -> /dev/pts/1
lrwx------ 1 root root 64 Apr 8 21:44 1 -> /dev/pts/1
lrwx------ 1 root root 64 Apr 8 21:44 2 -> /dev/pts/1 Showing the PID's and doing an $ docker run -d --rm --name php php:7.2-fpm-alpine
72b83fb1167d740951669fab6086bbd3d2084e4088d4ad5a1c8fe96042edbf33
$ docker exec php ps
PID USER TIME COMMAND
1 root 0:00 php-fpm: master process (/usr/local/etc/php-fpm.conf)
6 www-data 0:00 php-fpm: pool www
7 www-data 0:00 php-fpm: pool www
8 root 0:00 ps
# echo '/proc/1/fd/2' >/proc/1/fd/2
# echo '/proc/self/fd/1' >/proc/self/fd/1
# exit
$ docker logs php
[08-Apr-2019 21:42:52] NOTICE: fpm is running, pid 1
[08-Apr-2019 21:42:52] NOTICE: ready to handle connections
/proc/1/fd/2 Note that And then when in "attached" state the shell (or process) that you give after the image name is PID 1: $ docker run -it --rm --name php php:7.2-fpm-alpine ash
# ps
PID USER TIME COMMAND
1 root 0:00 ash
6 root 0:00 ps
# ls -al /proc/self/fd
lrwx------ 1 root root 64 Apr 8 22:03 0 -> /dev/pts/0
lrwx------ 1 root root 64 Apr 8 22:03 1 -> /dev/pts/0
lrwx------ 1 root root 64 Apr 8 22:03 2 -> /dev/pts/0 |
php-fpm 8.2 has problems with /dev/stderr |
Hi,
I cannot get the php-fpm error logs appear in docker std. So far I've tried many suggestions but for some reason no progress at all. I am posting my whole setup so that someone could kindly help me to right direction. All I see is
app_php_1 | 172.21.0.7 - 06/Apr/2019:12:26:37 +0000 "GET /index.php" 500
Thanks
config
PHP-FPM
Dockerfile
php.ini
www.conf
NGINX
Dockerfile
app.conf
nginx.conf
docker-compose.yml
WHAT I TRIED
I tried these independently from each other/file, not all in one go.
Changed
/proc/self/fd/2
to/dev/stdout
//dev/stderr
forerror_log
andaccess.log
properties in/usr/local/etc/php-fpm.d/docker.conf
file.Added code below at the bottom of
www.conf
file.The text was updated successfully, but these errors were encountered: