Home >Backend Development >PHP Tutorial >Code to force display of error messages when PHP is running_PHP Tutorial

Code to force display of error messages when PHP is running_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 15:31:07876browse

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 error information to a text file


How to output error information to a file? At the same time, error messages are not allowed to appear on the website. This is very good for debugging online projects. You can see the error messages yourself, but the client cannot! Is there any way
You can use set_error_handler to control

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323102.htmlTechArticleCopy the 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...
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