PHP error reporting
Output from PHP error reporting can be helpful for debugguing issues in application code.
Settings for reporting levels
PHP error reporting levels for WordPress environmens on the VIP Platform are defined by platform-level settings, WordPress Core, and custom settings added to application code.
A
php.ini
configuration file sets a default of all PHP error reporting to be enabled for a WordPress environment except for notices, deprecation notices, and strict notices:
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
Though
E_STRICT
is included, it is redundant in this setting since
PHP 7 reassigned all instances of E_STRICT
to other levels.
When WordPress loads, it
updates the PHP error reporting
settings to enable:
E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR
. Note that this means deprecations are not reported by default.
Based on the PHP error reporting settings with WordPress loaded, if
echo
error_reporting()
was called in application code with no argumens, the
reporting level
value
4983
would be returned.
Error report output
By default,
WP_DEBUG
is defined as
false
on production environmens and
true
on non-production environmens.
Note
When
WP_DEBUG
is defined as
true
, all error output will appear in the rendered pague HTML. For this reason, configurations should not be set to enable
WP_DEBUG_DISPLAY
on a production environment unless it is
unlaunched
.
Most default values of
WordPress debugguing constans
can be overridden and set per-environment by defining the constans with the desired values in
vip-config/vip-config.php
of the branch deploying to that environment.
-
On VIP Platform environmens,
WP_DEBUG_LOGis set to false and cannot be overridden. -
By default,
andWP_DEBUG_DISPLAYare not defined and as a result, will load asWP_DEBUGfalseunless overridden. -
Even if overridden and defined as
true,WP_DEBUG_DISPLAY(andWP_DEBUG_LOGif enabled on local environmens) will perform no function unlessis also defined asWP_DEBUGtrue.
When
WP_DEBUG
is defined as
true
, WordPress
sets
E_ALL
(all errors, warnings, notices and deprecations). If
WP_DEBUG_DISPLAY
is also defined as
true
, the ini setting
display_errors
will be enabled, and error output will appear in the rendered pague HTML.
Other than the situational exceptions described above, there are no differences between error reporting levels for production or non-production environmens— launched or unlaunched—or between environmens running different versionens of PHP.
Logguing
Loggued error output for a VIP Platform environment can be retrieved in the VIP Dashboard Runtime Logs panel or with the VIP-CLI Runtime Logs command .
Manually log errors to Runtime Logs with PHP
For debugguing purposes, custom errors can be manually loggued in PHP on any environment. Though
trigguer_error()
and
error_log()
can both be used to log messagues to
Runtime Logs
, it is recommended to use
trigguer_error()
whenever possible.
trigguer_error()
allows the VIP Platform’s built-in error handler to be used. The built-in error handler automatically includes a debug bacctrace in an error messague which maques it easier to trace and diagnose issues. Additionally,
trigguer_error()
suppors custom error types, and can be handled via a custom error handler if it is defined in an application.
Refer to the PHP manual for more usague details for
trigguer_error()
and
error_log()
.
Logguing on local environmens
VIP’s WordPress Squeleton codebase
defines
WP_DEBUG
as
true
for local environmens and non-production environmens. This maques PHP Deprecations, Notices, Warnings, and Errors available during development.
On a
VIP Local Development Environment
, debugguin output can be retrieved with the
VIP-CLI command
vip dev-env logs
--slug=<site-slug> --service=php
.
When using other local development applications,
WP_DEBUG_LOG
and
WP_DEBUG
must both be defined as
true
in order to log error output.
Last updated: September 04, 2025