Jump to content

PHP cannot set fastcgi.logging to 0

Recommended Posts

I have a very simple docker installation consisting of NGINX and PHP via FastCGI on port 9000.

I have configured my Dockerfile so that the PHP container copies “php.ini-production” to “php.ini” and then I copy in my own “php_settings.ini” into “conf.d”.

Currently the only settings I have in “php_settings.ini” are “fastcgi.logging = 0” and “display_errors = on” (this last one is just to confirm the file is being loaded).

Now, if my script has an error then the error is displayed as expected because “display_errors = on”.

However I am finding that “fastcgi.logging = 0” is not stopping PHP from logging all requests that are made, which is completely useless and unwanted and just clogs up the docker logs.

Note that if the PHP script runs phpinfo() it does show that “fastcgi.logging = 0” has been set.

But it does not appear to turn off SAPI logging which is what I want. Certainly, the docker logs contains one line for each request looking something like:

Quote - 01/Aug/2020:12:56:25 +0000 “GET /index.php” 200

Does anyone have any suggestion as to how this SAPI logging can be turned off?

Thanks …

For completeness, here is my Dockerfile for PHP:

FROM php:7.4-fpm

RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY application/php.ini "$PHP_INI_DIR/conf.d/php_settings.ini"

COPY src /var/www/html

CMD ["php-fpm"]


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.