Home > Article > Backend Development > How to check error messages in php
How to view error information in php: First use the ini_set() function to turn on the error prompt, such as [ini_set("display_errors", "On")]; then use the error_reporting() function to set the error reporting level.
PHP ini_set is used to set the value of php.ini, which takes effect when the function is executed. After the script ends, the setting becomes invalid. The configuration can be modified without opening the php.ini file.
(Recommended tutorial: php graphic tutorial)
Grammar format:
string ini_set(string $varname, string $newvalue)
error_reporting() function specifies which error to report, the function settings The error reporting level for the current script.
(Video tutorial recommendation: php video tutorial)
Grammar format:
error_reporting(report_level)
Just add the following two lines of code to the execution code.
ini_set("display_errors","On"); error_reporting(E_ALL);
The above is the detailed content of How to check error messages in php. For more information, please follow other related articles on the PHP Chinese website!