PHP Error Logs on IIS 7.5/Windows Server 2008
Asked Answered
S

2

17

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).

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:

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?

(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).

Sanalda answered 24/3, 2013 at 22:16 Comment(2)
Try #4764730Reine
Thanks - setting error_log = syslog and then using the Event Viewer did the trick.Sanalda
E
60

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

log_errors = On

Then set error_log to syslog for the windows event log:

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.

Elviraelvis answered 6/1, 2015 at 20:16 Comment(3)
This should be flagged as the answer.Mcclees
You also need to ensure error_reporting and log_errors_max_len are properly set. E.g. error_reporting=-1, log_errors_max_len=0.Spectroscope
Can you report it in different file for every file? I know it is totally possible on Apache but can't find it on IISMahan
A
-4

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

cd C:\xampp\apache\logs\

Use the following command to display the latest errors

tail -f .\error.log
Assets answered 12/7, 2019 at 14:48 Comment(1)
This solution is for Apache, not for IIS as it has been asked (and as I am looking for..).Unconscionable

© 2022 - 2024 — McMap. All rights reserved.