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

无忌哥哥
无忌哥哥Original
2018-07-20 10:14:116426browse

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!

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