Home  >  Article  >  Backend Development  >  How to solve the problem that php does not display error messages

How to solve the problem that php does not display error messages

王林
王林Original
2020-08-12 15:10:525480browse

Solution to php not displaying error messages: 1. Open the php.ini configuration file; 2. Modify the configuration [display_errors = On]; 3. Modify the configuration [error_reporting = E_ALL | E_STRICT].

How to solve the problem that php does not display error messages

Method 1: Modify the php.ini configuration file

(Recommended tutorial: php graphic tutorial)

; 第一处修改
; display_errors = Off
display_errors = On

; 第二处修改
; error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
error_reporting = E_ALL | E_STRICT

(Video tutorial recommendation: php video tutorial)

Method 2: Call the following function at the beginning of the php file

//禁用错误报告
error_reporting(0);
//报告运行时错误
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//报告所有错误
error_reporting(E_ALL);

The above is the detailed content of How to solve the problem that php does not display error messages. 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