【问题标题】:Zend : How to log PHP errorsZend:如何记录 PHP 错误
【发布时间】:2014-10-01 15:00:45
【问题描述】:

我对 Zend、PHP 和我的 Apache 服务器有一点问题。
所以我徘徊在生产环境中如何将错误和异常从 php 记录到 apache 日志中。

这是我用于生产环境的 application.ini:

phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
resources.frontController.throwExceptions = 0
resources.frontController.params.displayExceptions = 0

而且,对于开发环境,我有:

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.throwExceptions = 1
resources.frontController.params.displayExceptions = 1

所以我需要的是,用户看不到错误,但它们应该记录在我的 apache 日志中(就像在开发环境中一样)。

谢谢:)

【问题讨论】:

  • 您是否查看了访问和错误日​​志以了解它们是否正在更新?
  • 是的,访问已更新,但没有错误
  • 您应该自己处理错误记录。

标签: php apache zend-framework error-handling


【解决方案1】:

您想要的是打开 PHP error_reporting(在您想要的任何日志级别)并关闭 display_errors

【讨论】:

    猜你喜欢
    • 2018-07-19
    • 1970-01-01
    • 2014-01-01
    • 2012-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多