dqj96395
dqj96395
2015-01-23 15:06

WebPage无法访问更换错误[关闭]

已采纳

I have a weird problem when i have an error in my php code my webpage just display webpage inaccessible but not the errors. I have change my php init file by:

error_reporting  =  E_ALL & E_NOTICE & E_STRICT

but it don't change anything

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • doupoji3856 doupoji3856 6年前

    You are using the wrong operator here. Your line will only dispalay errors of type E_ALL and E_NOTICE and E_STRICT. Since an error can not match all three types, none is shown.

    Use the or operator | to include something or the and-not operatr `~&' to exclude something from E_ALL.

    error_reporting (E_ALL | E_NOTICE | E_STRICT);
    

    If you are talking about the settings in your php.ini, use this documentation:

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

    Warning: If you are specifying your error levels somewhere else, ex an apache config, use the numbers behind those constants and NOT the constants!

    http://php.net/manual/de/errorfunc.configuration.php#ini.error-reporting

    点赞 评论 复制链接分享

为你推荐