php IIS 7.5 在哪里记录错误?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4764230/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where does IIS 7.5 log errors?
提问by capdragon
Where does IIS 7.5 log errors?
IIS 7.5 在哪里记录错误?
Event Viewer? Log File?
事件查看器?日志文件?
I get a very non specific internal 500 error. I would like to find out more.
我收到一个非常非特定的内部 500 错误。我想了解更多。
I'm running PHP and I did what thislast comment on this post said. But still not logging to the C:\windows\temp
.
我正在运行 PHP,我做了这篇文章的最后一条评论。但仍然没有登录到C:\windows\temp
.
回答by NeerPatel
To report errors in the Event viewer, go to your php.ini and make sure logging is on.
要在事件查看器中报告错误,请转到您的 php.ini 并确保日志记录已打开。
log_errors = On
then enable error_log
to write to syslog
(with is the Event Viewer on Windows machines)
然后启用error_log
写入syslog
(Windows 机器上的事件查看器)
error_log = syslog
回答by MacGyver
For PHP v5.3, look here:
对于 PHP v5.3,请看这里:
C:\Windows\Temp\PHP53_errors.log
回答by frog
On my IIS 7.5 server I found this code in the php.ini file right down the bottom.
在我的 IIS 7.5 服务器上,我在底部的 php.ini 文件中找到了这段代码。
[WebPIChanges]
error_log=C:\Windows\temp\php54_errors.log
upload_tmp_dir=C:\Windows\temp
session.save_path=C:\Windows\temp
cgi.force_redirect=0
cgi.fix_pathinfo=1
fastcgi.impersonate=1
fastcgi.logging=0
max_execution_time=300
date.timezone=Australia/Canberra
extension_dir="C:\Program Files (x86)\PHP\v5.4\ext\"
I'm not sure if all of the above code is required because I'm not great with php.ini files but I can confirm the error log file is reachable and working.
我不确定是否需要上述所有代码,因为我对 php.ini 文件不太熟悉,但我可以确认错误日志文件可以访问并且可以正常工作。
This fix still requires the following if anyone is wondering.
如果有人想知道,此修复程序仍然需要以下内容。
log_errors = on
error_log = syslog
回答by JobJob
I once had a problem where the error log wasn't writeable by php. I added the IUSR user to the file's security permissions (right-click the file, properties, security tab) with read write and modify permissions and was then able to see php errors in the log file.
我曾经遇到过错误日志不能被 php 写入的问题。我将 IUSR 用户添加到具有读写和修改权限的文件的安全权限(右键单击文件、属性、安全选项卡),然后能够在日志文件中看到 php 错误。
回答by RedAnthrax
There should be a "Logging" icon on the site setup in IIS.
IIS 中的站点设置上应该有一个“日志记录”图标。
If you haven't changed the directory for that it looks like it defaults to %SystemDrive%\inetpub\logs\LogFiles
如果您没有更改目录,它看起来默认为 %SystemDrive%\inetpub\logs\LogFiles
Look in your settings and I'd also recommend creating a logs folder above your site files to keep your logs separated.
查看您的设置,我还建议您在站点文件上方创建一个日志文件夹,以将日志分开。