From 796942b6744132970f2d9db92b31a2a2cc3aa3cc Mon Sep 17 00:00:00 2001 From: nfebe Date: Sat, 27 Dec 2025 11:16:55 +0100 Subject: [PATCH] fix: Enable PHP error logging to stderr Configure PHP to output errors to stderr so they appear in docker logs. The base FrankenPHP image has log_errors disabled by default. Settings added: - log_errors = On - error_log = /proc/self/fd/2 - error_reporting = E_ALL - display_errors = Off Signed-off-by: nfebe --- Dockerfile | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index cb4392d..01e8370 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,15 @@ RUN apk add --no-cache \ RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip +RUN cat < /usr/local/etc/php/conf.d/error-logging.ini +[PHP] +log_errors = On +error_log = /proc/self/fd/2 +error_reporting = E_ALL +display_errors = Off +display_startup_errors = Off +EOF + WORKDIR /var/www/html RUN mkdir -p /data/caddy /config/caddy diff --git a/README.md b/README.md index 72f2e7b..e347203 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ USER www-data - Base: `dunglas/frankenphp:1-php{version}-alpine` - PHP Extensions: pdo_mysql, mbstring, exif, pcntl, bcmath, gd, zip - System packages: curl, libzip, libpng, libxml2, oniguruma, freetype, libjpeg-turbo +- PHP error logging configured to stderr (visible via `docker logs`) ## Environment Variables