php-fpm: refactor with deterministic config files & improved debug
All checks were successful
php-fpm-build / build (7.4) (push) Successful in 5m6s

This commit is contained in:
Elijah Duffy
2025-12-08 19:26:15 -08:00
parent 77ceaf6bb0
commit f3c65de9da
9 changed files with 71 additions and 35 deletions

View File

@@ -1,14 +1,23 @@
<?php
// force-debug.php
// This script is prepended to all PHP requests to force error reporting.
// 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;
}
// Set error reporting to the highest level.
error_reporting(E_ALL);
// Ensure errors are displayed directly in the browser.
// This overrides any ini_set('display_errors', 'Off') in the application.
ini_set('display_errors', '1');
// Also ensure errors are logged.
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');