Home > Backend Development > PHP Problem > How to cancel the error message displayed in php?

How to cancel the error message displayed in php?

coldplay.xixi
Release: 2023-03-02 17:36:01
Original
2685 people have browsed it

How to cancel the error message displayed in php: 1. Configure the [error_reporting] command code in the php configuration file [php.ini]; 2. Add [error_reporting(0)] at the beginning of the php file; 3. , add the [@] symbol at the beginning of the action that may cause errors.

How to cancel the error message displayed in php?

How to cancel the error prompt in php:

There are several ways to cancel the error prompt:

1. Configure the error_reporting instruction code in the php configuration file php.ini as follows:

error_reporting = 
error_reporting = ~E_ALL
Copy after login

In this way, any errors that occur in php will not be printed out unless in php Configure manually in the file.

2. Add error_reporting(0) at the beginning of the php file, so that any errors in the php file will be ignored and will not be printed out in the browser:

error_reporting(0);
Copy after login

3. Add the "@" symbol at the beginning of an action that may cause errors. At this time, any errors that may occur in this action will be ignored and no longer prompted.

Related learning recommendations: PHP programming from entry to proficiency

The above is the detailed content of How to cancel the error message displayed 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template