【发布时间】:2012-03-29 08:22:57
【问题描述】:
我想查看我的 php_error.log 文件是否有效,但我不知道如何产生将显示在日志文件中的错误。
感谢您的帮助!
【问题讨论】:
标签: php error-handling
我想查看我的 php_error.log 文件是否有效,但我不知道如何产生将显示在日志文件中的错误。
感谢您的帮助!
【问题讨论】:
标签: php error-handling
<?php
asd();
?>
保存并作为网页打开
错误应该是这样的
[Thu Mar 29 10:28:41 2012] [error] [client 106.132.155.92] PHP Fatal error: Call to undefined function asd() in * on line 2
[Thu Mar 29 10:28:41 2012] [error] [client 106.132.155.92] PHP Stack trace:
[Thu Mar 29 10:28:41 2012] [error] [client 106.132.155.92] PHP 1. {main}() *:0
【讨论】:
【讨论】:
ini_set('display_errors',1);
error_reporting(E_ALL);
echo =>
它会产生类似的错误
Parse error: syntax error, unexpected T_DOUBLE_ARROW in *filename*
on line *line number*
【讨论】:
这对我有用:
error_log("This is the error message written to the log", 0);
【讨论】: