PHP 8.0: PHP Startup Errors are displayed by default


PHP Startup Errors are emitted when PHP parses the INI files and starts up. These errors are different from standard application errors and their visibility is toggled with display_startup_errors INI directive. .

INI setting display_startup_errors controls whether the startup errors should be displayed.

Prior to PHP 8.0, the INI directive was set to Off, potentially hiding useful information. This value is set to On by default in PHP 8.0.

- display_startup_errors=Off
+ display_startup_errors=On = ""

The INI setting above is invalid, because the must be a non-empty non-numeric string. PHP emits a startup warning if it encounters such value:

# php -d"" test.php

Warning: PHP Startup: cannot be a numeric or empty '' in Unknown on line 0

A few such potential startup errors include:

  • Missing the module file ( Warning: PHP Startup: Unable to load dynamic library ''
  • Invalid value (""): Warning: PHP Startup: cannot be a numeric or empty '' in Unknown on line 0
  • Invalid session.upload_progress.freq value (session.upload_progress.freq=101%): Warning: PHP Startup: session.upload_progress.freq must be less than or equal to 100% in Unknown on line 0

Backwards Compatibility Impact

This is a mere default INI value change. It is possible to set this value back to Off in an INI file (more effective) or with a ini_set call (less effective).

ini_set('display_startup_errors', 'Off');

Related Changes