diff --git a/lib/setup.php b/lib/setup.php index cd652f669b030..d46131cfb03ac 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -234,7 +234,11 @@ } else { error_reporting(0); } - if (empty($CFG->debugdisplay)) { + if (NO_DEBUG_DISPLAY) { + // Some parts of Moodle cannot display errors and debug at all. + ini_set('display_errors', '0'); + ini_set('log_errors', '1'); + } else if (empty($CFG->debugdisplay)) { ini_set('display_errors', '0'); ini_set('log_errors', '1'); } else {