How to enable error prompts in php

王林
Release: 2023-03-03 22:18:01
Original
2726 people have browsed it

How to enable error prompts in php: You can directly use the ini_set() function to enable it. [ini_set("display_errors", "On")] means turning on error prompts; [ini_set("error_reporting",E_ALL)] means displaying all errors.

How to enable error prompts in php

Generally we do not modify the php.ini file directly. You can add the following two lines of code to the php file:

(Recommended tutorial:php graphic tutorial)

ini_set("display_errors", "On");//打开错误提示 ini_set("error_reporting",E_ALL);//显示所有错误
Copy after login

The most common settings of error_reporting:

(Video tutorial recommendation:Introduction to Programming)

E_ALL (显示所有错误,警告和通知,包括编码标准。) E_ALL & ~E_NOTICE (显示所有错误,通知除外) E_ALL & ~E_NOTICE & ~E_STRICT 显示所有错误,通知和编码标准警告除外。) E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (仅显示错误)
Copy after login

The above is the detailed content of How to enable error prompts in php. 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!