Home > Backend Development > PHP Tutorial > Five ways to teach you how to turn off php error echo information

Five ways to teach you how to turn off php error echo information

无忌哥哥
Release: 2023-04-03 09:56:01
Original
6417 people have browsed it

There are several ways to block error echo information:

1.php.ini's display_errors. Find the display_errors setting item in the php.ini file. If there is a semicolon in front of it, you need to delete the semicolon. And change the value to off

2.php.ini's error_reporting. This is to modify the error level display. If the level is set to the highest level, no errors will be displayed. Find error_reporting in php.ini. Remove the preceding semicolon (if any) and change the value to 0

3. Use the ini_set function to configure this method the same as methods 1 and 2, just write it in the code when php.ini cannot be modified. Use string ini_set (string $varname, string $newvalue)ini_set('display_errors', '0'); ini_set('error_reporting','0');

4. Use the error_reporting function int error_reporting ([ int $level ] )error_reporting(0);//Close all error reports

5. Use @ to mask the error echo of a single statement. Add the @ symbol before the statement that needs to mask the error echo

The above is the detailed content of Five ways to teach you how to turn off php error echo information. 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