Home  >  Article  >  Backend Development  >  What to do if php does not print errors

What to do if php does not print errors

PHPz
PHPzOriginal
2020-09-25 16:03:462303browse

Solution to php not printing errors: First open the php.ini configuration file; then modify [display_errors = On]; finally modify [error_reporting = E_ALL | E_STRICT].

What to do if php does not print errors

There are two methods to solve this problem, namely:

1. Modify php. ini file

; 第一处修改
; display_errors = Off
display_errors = On
 
; 第二处修改
; error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
error_reporting = E_ALL | E_STRICT

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);

If you want to learn more about programming, please pay attention php training column!

The above is the detailed content of What to do if php does not print errors. 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