What to do if php does not print errors

PHPz
Release: 2023-03-05 22:58:01
Original
2208 people have browsed it

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

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

If you want to learn more about programming, please pay attentionphp trainingcolumn!

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!

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
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!