From db15a713789966e8923597feaef7440daabf6fb3 Mon Sep 17 00:00:00 2001 From: Thorsten Bus Date: Mon, 30 Mar 2026 19:06:45 +0200 Subject: [PATCH] fix: pipe PHP/FPM errors to stderr for docker compose logs --- build/Dockerfile | 2 ++ build/php-error-logging.conf | 5 +++++ build/php-errors.ini | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 build/php-error-logging.conf create mode 100644 build/php-errors.ini diff --git a/build/Dockerfile b/build/Dockerfile index 1b555cc..8958a54 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -30,6 +30,8 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer WORKDIR /app COPY build/fpm-healthcheck.conf /usr/local/etc/php-fpm.d/zz-healthcheck.conf +COPY build/php-error-logging.conf /usr/local/etc/php-fpm.d/zz-error-logging.conf +COPY build/php-errors.ini /usr/local/etc/php/conf.d/errors.ini EXPOSE 9000 diff --git a/build/php-error-logging.conf b/build/php-error-logging.conf new file mode 100644 index 0000000..3d382ef --- /dev/null +++ b/build/php-error-logging.conf @@ -0,0 +1,5 @@ +[www] +catch_workers_output = yes +decorate_workers_output = no +php_admin_flag[log_errors] = on +php_admin_value[error_log] = /proc/self/fd/2 diff --git a/build/php-errors.ini b/build/php-errors.ini new file mode 100644 index 0000000..efc3205 --- /dev/null +++ b/build/php-errors.ini @@ -0,0 +1,5 @@ +log_errors = On +error_log = /proc/self/fd/2 +error_reporting = E_ALL +display_errors = Off +display_startup_errors = On