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

httpd/php log duplication #1291

Closed
douglas-legulas opened this issue Apr 14, 2022 · 2 comments
Closed

httpd/php log duplication #1291

douglas-legulas opened this issue Apr 14, 2022 · 2 comments

Comments

@douglas-legulas
Copy link

The problem

Here's a fragment of the output of docker compose logs showing the exact same php notice:

legulas_php      | NOTICE: PHP message: PHP Notice:  Undefined index: autenticado_painel in /var/www/public/taruma/index.php on line 3
legulas_httpd    | [Thu Apr 14 22:29:02.944401 2022] [proxy_fcgi:error] [pid 10:tid 140303436561208] [client 172.19.0.1:39244] AH01071: Got error 'PHP message: PHP Notice:  Undefined index: autenticado_painel in /var/www/public/taruma/index.php on line 3', referer: http://localhost/

The same happens to access logs:

legulas_php      | - -  14/Apr/2022:21:49:15 +0000 "GET /eadlegulas/meusDadosSeguranca.php" 200
legulas_httpd    | 172.19.0.1 - - [14/Apr/2022:21:49:15 +0000] "GET /eadlegulas/meusDadosSeguranca.php HTTP/1.1" 200 7015

This could be a simple configuration problem, but I couldn't figure it out by myself.

Details

php Dockerfile:

FROM php:7.4-fpm-alpine AS php

COPY ./zz-pool.conf ${PHP_INI_DIR}/../php-fpm.d/

Pool configuration (zz-pool.conf):

[www]
listen = /var/run/php-fpm/php-fpm.sock

httpd Dockerfile:

FROM httpd:2.4-alpine AS httpd

httpd proxy configuration:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so

<FilesMatch "\.php$">
    <If "-f %{REQUEST_FILENAME}">
        SetHandler "proxy:unix:/var/run/php-fpm/php-fpm.sock|fcgi://dummy/"
    </If>
</FilesMatch>
@yosifkit
Copy link
Member

This sounds similar to #878 (comment)

@douglas-legulas
Copy link
Author

douglas-legulas commented Apr 15, 2022

Thanks. Turning off fastcgi.logging eliminated the duplicated error logs.

fastcgi.logging = 0

Access logs continue duplicated, though, but that's ok.

I just hope this doesn't end up hiding important logs that don't show up anywhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants