php running error prompt

王林
Release: 2023-04-07 14:04:02
Original
2896 people have browsed it

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
Copy after login
; 第二处修改

; error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

error_reporting = E_ALL | E_STRICT
Copy after login

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
Copy after login

When it is enabled, if an error occurs, an error will be reported and an error message will appear.

dispaly_errors = Off
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!