php-fpm: refactor with deterministic config files & improved debug
All checks were successful
php-fpm-build / build (7.4) (push) Successful in 5m6s
All checks were successful
php-fpm-build / build (7.4) (push) Successful in 5m6s
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user