Open the php.ini file in the PHP installation directory
The code is as follows
Copy code
Find display_errors = On and change it to display_errors = off
Note: If you have copied the PHP.ini file to the windows directory, you must also change display_errors = On in c:windows/php.ini to display_errors = off
php program is opened
The code is as follows
Copy code
//Disable error reporting
error_reporting(0);
//Report runtime errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//Report all errors
error_reporting(E_ALL);
?>
Turning off error prompts in terms of performance will increase the server performance load a lot
Test 1:
Test the performance of uninitialized variables and initialized variables in 10000000 loops with error display turned off The loop code with initialized variables is as follows: The loop code with uninitialized variables is as follows:
Test results:
Initialization: 5.28 seconds average
Uninitialized: 17.2 seconds average
Performance gap: 3.25 times
Average timetable:
We can see that turning off PHP error output will not turn off the PHP kernel's error processing. If there are a large number of Notice-level errors in the code, it will still reduce the performance of the PHP program.
http://www.bkjia.com/PHPjc/631596.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631596.htmlTechArticleThis article introduces some PHP closing error prompt methods in PHP development. Friends in need can refer to this article. . 1. Close the notice error prompt 1. Change error_re... in the php.ini file
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