无法使 PHP 错误报告正常工作

发布于 2025-01-04 12:33:56 字数 441 浏览 0 评论 0原文

我检查了 php.ini 并且

log_errors = On
error_log = "c:/wamp/logs/php_error.log" `

(目录包含 access.log、apache_error.log、log.dir、mysql.log)

没有“error_reporting”条目,但有一条注释(我不太明白)

; Eval the expression with current error_reporting().  Set to true if you want
; error_reporting(0) around the eval().
; http://php.net/assert.quiet-eval
;assert.quiet_eval = 0

我会如果有人能帮助我,我会很感激。

I have checked php.ini and

log_errors = On
error_log = "c:/wamp/logs/php_error.log" `

(the dir contain access.log, apache_error.log, log.dir, mysql.log)

there is no entry for "error_reporting" but there is a comment (which I did not quite understand)

; Eval the expression with current error_reporting().  Set to true if you want
; error_reporting(0) around the eval().
; http://php.net/assert.quiet-eval
;assert.quiet_eval = 0

I would appreciate it if someone could help me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

感性 2025-01-11 12:33:56

只需在运行时设置即可:

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);

Just set it at runtime:

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
别理我 2025-01-11 12:33:56

另一个脚本设置了 error_reporting(0) 吗?

您的错误日志文件可写吗?

在你的 php.ini 中(或者正如其他发帖者在你的脚本中所说的那样)设置 error_reporting = E_ALL

你是否生成错误?

Is another script setting error_reporting(0)?

Is your error log file writable?

In your php.ini (or as the other poster said in your script) set error_reporting = E_ALL

Are you generating errors?

心在旅行 2025-01-11 12:33:56

以下内容位于我的 php.ini 文件中:

; Common Values:
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
error_reporting = E_ALL | E_STRICT

您应该能够将 error_reporting = 行以及适当的值添加到您的 php.ini 文件中,然后就可以开始了。

The following is in my php.ini file:

; Common Values:
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
error_reporting = E_ALL | E_STRICT

You should just be able to add the error_reporting = line to your php.ini file along with an appropriate value and be good to go.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文