For PHP errors, you must first enable PHP to report errors.
# Vim php. inilog_errors = On # error_reporting = E_ALL & ~ is enabled by default &~ E_DEPRECATED &~ E_STRICT # enabled by default # You can also temporarily switch the currently processed php error level error_reporting (E_ERROR | E_WARNING | E_PARSE) in the PHP code; # the function returns the previous error level
Second, configure the error log path
# Specify the php error log path # vim php. inierror_log =/var/log/php_errors.log # manually open
If the php error log path is not specified, the php error log is written to the error log path of the apache host.
WhenAfter an error is reported in PHPIn addition to writing errors into logs, we can also display the error information directly back to the browser for output.
!! In an online deployment environment, make sure to disable error echo !!
# Vim php. inidisplay_errors = On # manually enable it # You can also temporarily switch the currently processed error echo settings ini_set ('display _ errors ', '1') in php code ');