Home >Backend Development >PHP Problem >How to enable error prompts in php
How to enable error prompts in php: You can directly use the ini_set() function to enable it. [ini_set("display_errors", "On")] means turning on error prompts; [ini_set("error_reporting",E_ALL)] means displaying all errors.
Generally we do not modify the php.ini file directly. You can add the following two lines of code to the php file:
(Recommended tutorial: php graphic tutorial)
ini_set("display_errors", "On");//打开错误提示 ini_set("error_reporting",E_ALL);//显示所有错误
The most common settings of error_reporting:
(Video tutorial recommendation:Introduction to Programming)
E_ALL (显示所有错误,警告和通知,包括编码标准。) E_ALL & ~E_NOTICE (显示所有错误,通知除外) E_ALL & ~E_NOTICE & ~E_STRICT 显示所有错误,通知和编码标准警告除外。) E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (仅显示错误)
The above is the detailed content of How to enable error prompts in php. For more information, please follow other related articles on the PHP Chinese website!