Home >Backend Development >PHP Tutorial >http://www.12306.cn/mormhweb/ Code to force display of error messages when PHP is running

http://www.12306.cn/mormhweb/ Code to force display of error messages when PHP is running

WBOY
WBOYOriginal
2016-07-29 08:44:481064browse

Copy code The code is as follows:


error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); //Output the error message to a text file


How to output the error message to a file without letting the error message appear on the website? This is very good for debugging online projects. You can see the error message yourself, but the customer Can't see it! Is there any way
You can use set_error_handler to control

The above introduces the code for forcing the display of error messages when PHP is running at http://www.12306.cn/mormhweb/, including the content of http://www.12306.cn/mormhweb/. I hope you are interested in the PHP tutorial. Friends help.

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