From 3928433bd296cf7d63fd93adedb4efbf822134af Mon Sep 17 00:00:00 2001 From: Jeff Turner Date: Thu, 21 Aug 2025 20:07:27 +1000 Subject: [PATCH] Add a comment about where PHP error_log() output goes. #2680 --- examples/development/php/latest/devbox.d/php/php-fpm.conf | 7 +++++++ examples/flakes/php/devbox.d/php/php-fpm.conf | 7 +++++++ examples/plugins/builtin/devbox.d/php82/php-fpm.conf | 7 +++++++ examples/stacks/drupal/devbox.d/php/php-fpm.conf | 7 +++++++ examples/stacks/lapp-stack/devbox.d/php/php-fpm.conf | 7 +++++++ examples/stacks/laravel/devbox.d/php/php-fpm.conf | 7 +++++++ examples/stacks/lepp-stack/devbox.d/php/php-fpm.conf | 7 +++++++ plugins/php/php-fpm.conf | 7 +++++++ 8 files changed, 56 insertions(+) diff --git a/examples/development/php/latest/devbox.d/php/php-fpm.conf b/examples/development/php/latest/devbox.d/php/php-fpm.conf index b9359574722..83d967fae84 100644 --- a/examples/development/php/latest/devbox.d/php/php-fpm.conf +++ b/examples/development/php/latest/devbox.d/php/php-fpm.conf @@ -1,5 +1,6 @@ [global] pid = ${PHPFPM_PID_FILE} +; Note: this is PHP-FPM's error log, not PHP's (see below) error_log = ${PHPFPM_ERROR_LOG_FILE} daemonize = yes @@ -15,3 +16,9 @@ pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 chdir = / + +; Note: PHP's error_log() output is typically found in your webserver error log, not in PHP-FPM's. By default error_log() writes to stderr (unless 'error_log' is set in php.log), and then on to the FastCGI client (the webserver), which logs it. If you want error_log() logged at the PHP-FPM layer, set a file here: +; +; php_admin_value[error_log] = ... +; php_admin_flag[log_errors] = on + diff --git a/examples/flakes/php/devbox.d/php/php-fpm.conf b/examples/flakes/php/devbox.d/php/php-fpm.conf index b9359574722..83d967fae84 100644 --- a/examples/flakes/php/devbox.d/php/php-fpm.conf +++ b/examples/flakes/php/devbox.d/php/php-fpm.conf @@ -1,5 +1,6 @@ [global] pid = ${PHPFPM_PID_FILE} +; Note: this is PHP-FPM's error log, not PHP's (see below) error_log = ${PHPFPM_ERROR_LOG_FILE} daemonize = yes @@ -15,3 +16,9 @@ pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 chdir = / + +; Note: PHP's error_log() output is typically found in your webserver error log, not in PHP-FPM's. By default error_log() writes to stderr (unless 'error_log' is set in php.log), and then on to the FastCGI client (the webserver), which logs it. If you want error_log() logged at the PHP-FPM layer, set a file here: +; +; php_admin_value[error_log] = ... +; php_admin_flag[log_errors] = on + diff --git a/examples/plugins/builtin/devbox.d/php82/php-fpm.conf b/examples/plugins/builtin/devbox.d/php82/php-fpm.conf index b9359574722..83d967fae84 100644 --- a/examples/plugins/builtin/devbox.d/php82/php-fpm.conf +++ b/examples/plugins/builtin/devbox.d/php82/php-fpm.conf @@ -1,5 +1,6 @@ [global] pid = ${PHPFPM_PID_FILE} +; Note: this is PHP-FPM's error log, not PHP's (see below) error_log = ${PHPFPM_ERROR_LOG_FILE} daemonize = yes @@ -15,3 +16,9 @@ pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 chdir = / + +; Note: PHP's error_log() output is typically found in your webserver error log, not in PHP-FPM's. By default error_log() writes to stderr (unless 'error_log' is set in php.log), and then on to the FastCGI client (the webserver), which logs it. If you want error_log() logged at the PHP-FPM layer, set a file here: +; +; php_admin_value[error_log] = ... +; php_admin_flag[log_errors] = on + diff --git a/examples/stacks/drupal/devbox.d/php/php-fpm.conf b/examples/stacks/drupal/devbox.d/php/php-fpm.conf index b9359574722..83d967fae84 100644 --- a/examples/stacks/drupal/devbox.d/php/php-fpm.conf +++ b/examples/stacks/drupal/devbox.d/php/php-fpm.conf @@ -1,5 +1,6 @@ [global] pid = ${PHPFPM_PID_FILE} +; Note: this is PHP-FPM's error log, not PHP's (see below) error_log = ${PHPFPM_ERROR_LOG_FILE} daemonize = yes @@ -15,3 +16,9 @@ pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 chdir = / + +; Note: PHP's error_log() output is typically found in your webserver error log, not in PHP-FPM's. By default error_log() writes to stderr (unless 'error_log' is set in php.log), and then on to the FastCGI client (the webserver), which logs it. If you want error_log() logged at the PHP-FPM layer, set a file here: +; +; php_admin_value[error_log] = ... +; php_admin_flag[log_errors] = on + diff --git a/examples/stacks/lapp-stack/devbox.d/php/php-fpm.conf b/examples/stacks/lapp-stack/devbox.d/php/php-fpm.conf index b9359574722..83d967fae84 100644 --- a/examples/stacks/lapp-stack/devbox.d/php/php-fpm.conf +++ b/examples/stacks/lapp-stack/devbox.d/php/php-fpm.conf @@ -1,5 +1,6 @@ [global] pid = ${PHPFPM_PID_FILE} +; Note: this is PHP-FPM's error log, not PHP's (see below) error_log = ${PHPFPM_ERROR_LOG_FILE} daemonize = yes @@ -15,3 +16,9 @@ pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 chdir = / + +; Note: PHP's error_log() output is typically found in your webserver error log, not in PHP-FPM's. By default error_log() writes to stderr (unless 'error_log' is set in php.log), and then on to the FastCGI client (the webserver), which logs it. If you want error_log() logged at the PHP-FPM layer, set a file here: +; +; php_admin_value[error_log] = ... +; php_admin_flag[log_errors] = on + diff --git a/examples/stacks/laravel/devbox.d/php/php-fpm.conf b/examples/stacks/laravel/devbox.d/php/php-fpm.conf index 7d0e2b79ce8..c0c17e4da87 100644 --- a/examples/stacks/laravel/devbox.d/php/php-fpm.conf +++ b/examples/stacks/laravel/devbox.d/php/php-fpm.conf @@ -1,5 +1,6 @@ [global] pid = ${PHPFPM_PID_FILE} +; Note: this is PHP-FPM's error log, not PHP's (see below) error_log = ${PHPFPM_ERROR_LOG_FILE} [www] @@ -14,3 +15,9 @@ pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 chdir = / + +; Note: PHP's error_log() output is typically found in your webserver error log, not in PHP-FPM's. By default error_log() writes to stderr (unless 'error_log' is set in php.log), and then on to the FastCGI client (the webserver), which logs it. If you want error_log() logged at the PHP-FPM layer, set a file here: +; +; php_admin_value[error_log] = ... +; php_admin_flag[log_errors] = on + diff --git a/examples/stacks/lepp-stack/devbox.d/php/php-fpm.conf b/examples/stacks/lepp-stack/devbox.d/php/php-fpm.conf index b9359574722..83d967fae84 100644 --- a/examples/stacks/lepp-stack/devbox.d/php/php-fpm.conf +++ b/examples/stacks/lepp-stack/devbox.d/php/php-fpm.conf @@ -1,5 +1,6 @@ [global] pid = ${PHPFPM_PID_FILE} +; Note: this is PHP-FPM's error log, not PHP's (see below) error_log = ${PHPFPM_ERROR_LOG_FILE} daemonize = yes @@ -15,3 +16,9 @@ pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 chdir = / + +; Note: PHP's error_log() output is typically found in your webserver error log, not in PHP-FPM's. By default error_log() writes to stderr (unless 'error_log' is set in php.log), and then on to the FastCGI client (the webserver), which logs it. If you want error_log() logged at the PHP-FPM layer, set a file here: +; +; php_admin_value[error_log] = ... +; php_admin_flag[log_errors] = on + diff --git a/plugins/php/php-fpm.conf b/plugins/php/php-fpm.conf index b9359574722..83d967fae84 100644 --- a/plugins/php/php-fpm.conf +++ b/plugins/php/php-fpm.conf @@ -1,5 +1,6 @@ [global] pid = ${PHPFPM_PID_FILE} +; Note: this is PHP-FPM's error log, not PHP's (see below) error_log = ${PHPFPM_ERROR_LOG_FILE} daemonize = yes @@ -15,3 +16,9 @@ pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 chdir = / + +; Note: PHP's error_log() output is typically found in your webserver error log, not in PHP-FPM's. By default error_log() writes to stderr (unless 'error_log' is set in php.log), and then on to the FastCGI client (the webserver), which logs it. If you want error_log() logged at the PHP-FPM layer, set a file here: +; +; php_admin_value[error_log] = ... +; php_admin_flag[log_errors] = on +