PHP Error Logs on IIS 7.5/Windows Server 2008

2020-06-01 06:58发布

问题:

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

回答1:

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.



回答2:

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