|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28988 Syslog NOT logging Errors to the Event Viewer
Submitted: 2004-07-01 22:47 UTC Modified: 2004-08-06 01:00 UTC
Avg. Score:4.0 ± 0.6
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:4 (80.0%)
From: mgilbert at kcm dot org Assigned:
Status: No Feedback Package: IIS related
PHP Version: 4.3.7 OS: Windows Server 2003
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-07-01 22:47 UTC] mgilbert at kcm dot org
This error was orrigionally logged at an IIS forum. The Forum administrator had the same problem and sugested that we logg this error on the PHP web site. Below is some of the text from our origional message. This is the link to the origional message:

We recently migrated a website from Windows 2000 to Windows 2003 using the iis 6.0 Migration tool provided by Microsoft.

PHP is installed and seems to work fine with the exception of a challenge one of my developers approached me with recently. This function works fine on Windows 2000, but doesn't on Windows 2003. He has some code to log errors to the system event log but the events are not getting logged.

We have logging enabled in the PHP.ini :
; Log errors to syslog (Event Log on NT, not valid in Windows 95).
error_log = syslog

I've attempted giving IUSR_website account more permissions on the box (including administrative rights for a very short period of time to make sure that NTFS permissions are not blocking anything)

Any information you could provide would be greatly appreciated. Thanks,

Reproduce code:
if ($priority <> "")


openlog("Website", LOG_ODELAY, LOG_USER);

syslog($priority, $error_log);



Expected result:
It should log an event in the event Windows Event Viewer.

Actual result:
Did not log the event.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-27 17:58 UTC] msisolak at yahoo dot com
If you run a script with the code snippet you have interactively from a command prompt (logged in as a Administrator user) is it able to write to the Event Log?
 [2004-07-27 23:06 UTC] mgilbert at kcm dot org
I am working with one of our guys in our DCAT dept to test this (I do not have admin rights). I will let you know the results.

Thank you for responding
 [2004-07-28 21:33 UTC] mgilbert at kcm dot org
OK We just tried the test. I wrote a simple PHP script that logs and event and echos the message to the screen. When we run that PHP script from the command line interface it loggs the event to the event viewer. When we run the same script from a Web Browser it does not logg the event to the event viewer. We have checked all of the security settings, in fact temporarily they gave IIS Admin privaliges and it still did not logg to the event viewer.
 [2004-07-29 05:02 UTC] msisolak at yahoo dot com
It sounds like the tighter security settings of Server 2003 are blocking the event logging requests when run from within IIS.  Here is a pretty good summary of the issue and how to configure your server so that the IUSR account has Event Viewer write permissions:

There is also this basic summary of the issues from Microsoft:;en-us;323076
 [2004-07-29 05:03 UTC]
Please try using this CVS snapshot:
For Windows:

I fixed some thread safety issues with the syslog emulation we use on win32.
Please try the next PHP 5.1 (unstable) snapshot dated after this message; if you report the issue as resolved, we can investigate back-porting the changes.
 [2004-07-29 05:05 UTC]
Of course, it could just be tighter security; check that first, but be warned that there are some thread safety issues in the syslog implementation in all current stable releases of PHP.
 [2004-08-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 03:01:32 2024 UTC