Home >Backend Development >PHP Tutorial >php running error prompt
The first method
Change the values of display_errors and error_reporting in the php.ini file. If not, add them directly.
; 第一处修改 ; display_errors = Off display_errors = On
; 第二处修改 ; error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT error_reporting = E_ALL | E_STRICT
display_errors
Error echo is commonly used in development mode, but many applications forget to turn off this option in the formal environment. Error echo can expose a lot of sensitive information, which facilitates the attacker's next attack. It is recommended to turn this option off.
display_errors = On
When it is enabled, if an error occurs, an error will be reported and an error message will appear.
dispaly_errors = Off
In the closed state, if an error occurs, it will prompt: Server error, but no error message will appear.
The second method
Add the following two sentences to Apache’s httpd.conf file:
php_flag display_errors on php_value error_reporting 2039
Recommended tutorial: PHP video Tutorial
The above is the detailed content of php running error prompt. For more information, please follow other related articles on the PHP Chinese website!