Home  >  Article  >  Backend Development  >  php running error prompt

php running error prompt

王林
王林Original
2019-10-08 13:35:512934browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn