php 删除输出错误,PHP 输出两次错误信息

使用命令行方式运行PHP总是出现两次错误提示,在浏览器中则只显示一条并且显示的是下面的第二条。

PHP Fatal error: Cannot use object of type stdClass as array in E:\document\wwwroot\data\app\model\afe\gather\iTunesModel.php on line 100

Fatal error: Cannot use object of type stdClass as array in E:\document\wwwroot\data\app\model\afe\gather\iTunesModel.php on line 100

php版本:

PHP 5.3.10 (cli) (built: Feb 2 2012 20:27:51)

Copyright (c) 1997-2012 The PHP Group

Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

提示两次错误很不爽,最后在http://stackoverflow.com/questions/9001911/why-are-php-errors-printed-twice找到了答案,原因是开启了log_errors = On但是没有指定log的位置所以log_errors就跑到了标准输出中,设置log_errors=off解决问题。浏览器访问只显示一条错误信息因为php-fpm中制定了error_log的位置,而且php-fpm中的这个优先级比php.ini的高,如下:

; Additional php.ini defines, specific to this pool of workers. These settings

; overwrite the values previously defined in the php.ini. The directives are the

; same as the PHP SAPI:

; php_value/php_flag - you can set classic ini defines which can

; be overwritten from PHP call 'ini_set'.

; php_admin_value/php_admin_flag - these directives won't be overwritten by

; PHP call 'ini_set'

; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.

; Defining 'extension' will load the corresponding shared extension from

; extension_dir. Defining 'disable_functions' or 'disable_classes' will not

; overwrite previously defined php.ini values, but will append the new value

; instead.

; Default Value: nothing is defined by default except the values in php.ini and

; specified at startup with the -d argument

;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com

;php_flag[display_errors] = off

php_admin_value[error_log] = /var/log/php-fpm/www-error.log

php_admin_flag[log_errors] = on

;php_admin_value[memory_limit] = 32M

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值