Skip to content
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

No way to get errors from php:7.2-fpm-alpine #690

Closed
RoestVrijStaal opened this issue Jul 19, 2018 · 4 comments
Closed

No way to get errors from php:7.2-fpm-alpine #690

RoestVrijStaal opened this issue Jul 19, 2018 · 4 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@RoestVrijStaal
Copy link

Hi,

I stole a docker building for my own purpose: https://github.com/FabianMartin/docker-php-symfony/blob/master/alpine-php/7.2-xdebug

Unfortunately I got "connection reinitialised" at each time accessing the site via the browser (e.g. 127.0.0.1:9000). It's very hard to debug because I don't get any error messages from the php-fpm docker service.

I see php:7.2-fpm-alpine uses /proc/self/fd/2 and so do the files in the repository I linked above.

Unfortunately I don't get any errors in my console. Trying to let them output in /var/log/error.log in my container didn't work. /var/log/error.log isn't even created.

How to fix? Any ideas are welcome.

@wglambert
Copy link

In the Dockerfile error_log and access.log are redirected to stderr not stdout.

echo '[global]'; \
echo 'error_log = /proc/self/fd/2'; \
echo; \
echo '[www]'; \
echo '; if we send this to /proc/self/fd/1, it never appears'; \
echo 'access.log = /proc/self/fd/2'; \
echo; \
echo 'clear_env = no'; \
echo; \
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
echo 'catch_workers_output = yes'; \

For why this is: #358 (comment)

php-fpm likely closes STDOUT as part of its own startup routines.

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Jul 19, 2018
@tianon
Copy link
Member

tianon commented Jul 20, 2018

Unfortunately I got "connection reinitialised" at each time accessing the site via the browser ...

When using the FPM variants, the 9000 port is not exposing the HTTP protocol, but is rather exposing the FastCGI protocol, so in order to do anything useful with it, you'll need something like NGINX or Apache in front translating HTTP requests to and from FastCGI.

There are also tools like cgi-fcgi which can be used to interact directly, but the experience is definitely going to be very raw (since again, a FastCGI server is not a "proper" web server by itself, but rather a lower-level building block for connecting other languages to a web server).

@tianon tianon closed this as completed Jul 20, 2018
@RoestVrijStaal
Copy link
Author

Hmmm, Since xdebug uses port 9000 by default (which i rather want not to change), I might not be interested in php-fpm (anymore).

@wglambert @tianon thanks for the help

@ThomasNegeli
Copy link

@RoestVrijStaal there is no problem with fpm and xdebug on port 9000.
xdebug is connecting to your host on port 9000. fpm is accepting connections on port 9000, but this is within your Docker Container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

4 participants