IIS 7.5/Windows Server 2008 上的 PHP 错误日志

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15604695/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 09:35:02  来源:igfitidea点击:

PHP Error Logs on IIS 7.5/Windows Server 2008

phpiis-7.5windows-server-2008-r2

提问by user982124

I'm confused about where I should be looking for a log file containing php errors on a Windows 2008 Server running IIS 7.5 (I'm more familiar with the Mac OS X setup for this).

我对在运行 IIS 7.5 的 Windows 2008 服务器上应该在哪里查找包含 php 错误的日志文件感到困惑(我更熟悉 Mac OS X 设置)。

In my php.ini file I have log_errors set to "On" but I'm not seeing any php errors in the IIS logs that appear in this folder:

在我的 php.ini 文件中,我将 log_errors 设置为“On”,但在此文件夹中出现的 IIS 日志中我没有看到任何 php 错误:

C\inetpub\logs\LogFiles

C\inetpub\logs\LogFiles

Is it possible to have the php errors included in this file or do I need to specify a new file just for php errors?

是否可以在此文件中包含 php 错误,或者我是否需要为 php 错误指定一个新文件?

(I'm trying to troubleshoot a site that is generating 500 – Internal server error for a php error. I've found this site http://www.webdigi.co.uk/blog/2009/php-on-windows-server-2008-500-internal-server-error-on-iis/that explains how I can view the error when accessing the page via an RDP session on the server, but I need to be able to log these and view the log as I won't always have RDP access).

(我正在尝试对一个生成 500 的站点进行故障排除 - php 错误的内部服务器错误。我找到了这个站点http://www.webdigi.co.uk/blog/2009/php-on-windows- server-2008-500-internal-server-error-on-iis/解释了在通过服务器上的 RDP 会话访问页面时如何查看错误,但我需要能够记录这些并查看日志我不会总是拥有 RDP 访问权限)。

回答by Zymotik

In the php.ini (you can find this under "c:\program files (x86)\php\{PHP Version}")change these settings:

在 php.ini (您可以在“c:\program files (x86)\php\{PHP Version}”下找到)更改这些设置:

log_errors = On

Then set error_logto syslogfor the windows event log:

然后设置的error_log系统日志的Windows事件日志:

error_log = syslog

Or specify a location on disk such as:

或者在磁盘上指定一个位置,例如:

error_log = C:\Windows\temp\php_errors.log

Make sure that the error_logor log_errorvalues aren't being set elsewhere in the file.

确保没有在文件的其他地方设置error_loglog_error值。

回答by ageans

If you are using xampp in windows. The error log can be find in

如果您在 Windows 中使用 xampp。错误日志可以在

cd C:\xampp\apache\logs\

Use the following command to display the latest errors

使用以下命令显示最新的错误

tail -f .\error.log