Error logging with WAMP server in PHP

佐手、 提交于 2019-12-19 17:27:13

问题


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_ERROR errors, or cause normal ERROR errors.

I'm including the error relevant sections of the php.ini file - hopefully you can find something:

error_reporting = E_ALL

error_log = "c:/wamp32/logs/php_error.log" ;(UNCOMMENTED BY ME)

log_errors = On
display_errors = On

回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/9230984/error-logging-with-wamp-server-in-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!