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).
Look for the entry Configuration File (php. Find the Error handling and logging section of the php. ini file. Make sure that both display_errors = On, display_startup_errors = On and log_errors = On are present and uncommented. Check the value of error_log - this tells you the location of the file errors are logged to.
Enable Error Logging in php. If you want to enable PHP error logging in individual files, add this code at the top of the PHP file. ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); Now, you must enable only one statement to parse the log errors in the php.
If the syslog is used, then all PHP errors will be sent directly to the default system log file—in Linux, this is typically /var/log/syslog.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With