【问题标题】:info.php shows log_errors is Off but it is set to be On in the php.ini of Loaded Configuration Fileinfo.php 显示 log_errors 为 Off 但在 Loaded Configuration File 的 php.ini 中设置为 On
【发布时间】:2017-01-18 16:56:47
【问题描述】:

PHP 信息页面显示 log_errors 设置为 Off 即使我将其设置为 On

在 info.php 页面中显示:

  • Loaded Configuration File -> /etc/php/7.0/apache2/php.ini
  • Scan this dir for additional .ini files -> /etc/php/7.0/apache2/conf.d

修改后的 php.ini 文件的顶部:

[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini   ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

display_errors = On
log_errors = On
error_log = /var/log/php-errors.log

我已经跟踪了 php.ini 文件的其余部分,并找到了我也设置为 On 的其他 log_error 参考 log_errors = 开启

我不确定是否应该使用 ini_set('display_errors', 1); .ini 文件中的格式,我已经找到了有关此的答案,并使用一切来测试是否有任何工作但仍然有效。

那么配置有什么问题?

注意:是的,我已经重启了 apache2。

使用最新的 Ubuntu Server x64 16.04 运行 PHP 版本 7.0.13-0ubuntu0.16.04.1

【问题讨论】:

    标签: debugging php


    【解决方案1】:
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
    

    在 ini 文件中不起作用。 启用错误报告在您的 ini 文件中写入以下行

    error_reporting = E_ALL

    更多信息请参考here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-29
      • 1970-01-01
      • 2013-06-25
      • 2017-04-29
      • 1970-01-01
      • 2013-06-09
      相关资源
      最近更新 更多