2012-02-09 81 views
0

我已经检查php.ini并无法让PHP错误报告工作

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 

我将不胜感激,如果有人可以帮助我。

+0

'error_reporting()'是一个在脚本中调用的函数。 – Brad 2012-02-09 22:18:19

+0

您使用的是哪个版本的PHP? – 2012-02-09 22:24:56

回答

3

设置它在运行时:

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

In * every * script?看起来并不实际,特别是如果您将在开发和生产环境之间进行转换。 – 2012-02-09 22:26:03

+0

@GigaWatt:你可以在引导文件中执行一次,或者像配置文件一样全局包含的任何文件。 – 2012-02-09 22:27:23

+0

@千兆瓦不在每个脚本中:P ^^什么Madmartigan说:-) – PeeHaa 2012-02-09 23:03:49

0

以下是我的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文件以及适当的价值和好的去。

1

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

您的错误日志文件是否可写?

在php.ini中(或其他海报在你的脚本说)设定的error_reporting = E_ALL

你产生错误?