Files
wordpress-docker/shared/php-fpm/force-debug.php
Elijah Duffy f3c65de9da
All checks were successful
php-fpm-build / build (7.4) (push) Successful in 5m6s
php-fpm: refactor with deterministic config files & improved debug
2025-12-08 19:26:15 -08:00

24 lines
578 B
PHP

<?php
// force-debug.php
// Optional debug bootstrap that can be toggled with FORCE_DEBUG_ERRORS=1.
$forceDebug = getenv('FORCE_DEBUG_ERRORS');
if ($forceDebug === false) {
return;
}
$normalized = strtolower(trim($forceDebug));
$enabled = in_array($normalized, ['1', 'true', 'yes', 'on'], true);
if (!$enabled) {
return;
}
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
ini_set('log_errors', '1');
ini_set('error_log', '/proc/self/fd/2');
error_log('[force-debug] Verbose error reporting enabled via FORCE_DEBUG_ERRORS');