Oihana PHP System

initErrors.php

Table of Contents

Functions

initErrors()  : void
Initialize the global PHP error settings.

Functions

initErrors()

Initialize the global PHP error settings.

initErrors([array<string|int, mixed>|null $init = null ][, string|null $logRootPath = null ][, int $defaultErrorLevel = E_ALL ]) : void

This function sets PHP error reporting and ini directives related to error display and logging, based on the provided configuration array and optional log root path.

It applies the following settings:

  • error_reporting level (defaulting to $defaultErrorLevel if not provided)
  • display_errors (ini directive)
  • display_startup_errors (ini directive)
  • error_log (ini directive), with an optional root path prefix
Parameters
$init : array<string|int, mixed>|null = null

Optional associative array of ini settings.

$logRootPath : string|null = null

Optional root directory path to prepend to error_log path if it is relative.

$defaultErrorLevel : int = E_ALL

Default error reporting level to use if none is set in $init.

Tags
throws
ConstantException
see
IniOptions

        
On this page

Search results