Error logging with WAMP server in PHP

后端 未结 3 1887
鱼传尺愫
鱼传尺愫 2021-01-18 06:02

I have a WAMP 2.2 server running on a Windows 7 box and cannot get PHP error logging working at all.

The file is always blank even after I explicitly trigger USER_ER

相关标签:
3条回答
  • 2021-01-18 06:30

    Did you try adding these lines to your php file?

    ini_set("display_errors", "1");
    ini_set("log_errors", "1");
    ini_set("error_log", "/wamp64/logs/php_error.log");
    
    0 讨论(0)
  • 2021-01-18 06:44

    The line ; log_errors is just a comment for the following block, for the purpose of showing you what the settings are in dev vs production. You uncommented four lines which aren't meant to control anything, and I'm surprised your Apache service doesn't have problems starting up because of it.

    What you need to do is look for the line:

    log_errors = Off
    

    And change the value to On

    That said, once you restart the Apache service, the settings should take effect. However, I was unable to get WampServer to properly log php errors despite these settings. Apache will not start up when I specify the error_log parameter.

    0 讨论(0)
  • 2021-01-18 06:45

    For me it turned out to be a permissions error. I ended up giving EVERYONE full control of the error log file and it seemed to fix my issue. Best of luck.

    0 讨论(0)
提交回复
热议问题