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

时间:2022-06-27 20:30:20

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 Server上寻找包含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

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访问权限)。

2 个解决方案

#1


38  

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_log to syslog for the windows event log:

然后将error_log设置为syslog以获取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_log or log_error values aren't being set elsewhere in the file.

确保未在文件的其他位置设置error_log或log_error值。

#2


-2  

The details in the answer at:

答案中的详细信息:

Where does IIS 7.5 log errors?

IIS 7.5在哪里记录错误?

should suffice, along with the site referenced:

应该足够,以及引用的网站:

http://www.iis-aid.com/articles/how_to_guides/logging_php_to_windows_event_log

Setting error_log = syslog then restarting IIS and using the Event Viewer did the trick.

设置error_log = syslog然后重新启动IIS并使用事件查看器就可以了。

#1


38  

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_log to syslog for the windows event log:

然后将error_log设置为syslog以获取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_log or log_error values aren't being set elsewhere in the file.

确保未在文件的其他位置设置error_log或log_error值。

#2


-2  

The details in the answer at:

答案中的详细信息:

Where does IIS 7.5 log errors?

IIS 7.5在哪里记录错误?

should suffice, along with the site referenced:

应该足够,以及引用的网站:

http://www.iis-aid.com/articles/how_to_guides/logging_php_to_windows_event_log

Setting error_log = syslog then restarting IIS and using the Event Viewer did the trick.

设置error_log = syslog然后重新启动IIS并使用事件查看器就可以了。