ID:               8314
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Analyzed
 Bug Type:         PHP options/info functions
 Operating System: Win2k pro
 PHP Version:      4.0.3pl1
 New Comment:

The problems with allowing PHP to register arbitrary event sources
are:

1. PHP might not have permissions to write to that part
   of the registry, so it might not even be able to do it.
2. If it does, it could overwrite system defined message
   sources -> big problem for shared hosters.

IMO, it is better to register a single PHP event source at
installation time, and adapt the syslog code to log messages
using PHP as the source and output the user-defined source
in the log message itself.



Previous Comments:
------------------------------------------------------------------------

[2003-10-07 12:27:52] rick_g22 at yahoo dot com

I see. In any case, I think it'll be easy to register PHP as the source
for PHP-error logs, right?

Thanks! (This is my last comment)

------------------------------------------------------------------------

[2003-10-07 12:18:08] [EMAIL PROTECTED]

No, its not possible.
All eventcreate does is register itself as the source.
Try this:

eventcreate /t error /id 100 /l application /so foobar /d "This is a
message"

and look here in the registry afterwards:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\foobar


------------------------------------------------------------------------

[2003-10-07 12:10:44] rick_g22 at yahoo dot com

OK I think i figured out something.

WinNT / XP has this commandline tool, eventcreate.exe.

I type from the command (DOS) prompt:

eventcreate /t error /id 100 /l application /d "Testing..."

And I get the similar error. No description for source, etc. etc.

But if I type:

eventcreate /t error /id 100 /l application /so myself /d "Testing..."

this is what I get the right description, and the origin is listed as
"msyelf". So probably in the WinNT/XP API there is a way to indicate
the origin with a string without the need to register it... in our
case, the origin should be "PHP". Perhaps the origin could change
between "PHP CLI", "PHP CGI" o "PHP SAPI".

I'm currently trying to figure out if there is a COM object for the
event log or something to implement a workaround.

------------------------------------------------------------------------

[2003-10-07 11:57:16] [EMAIL PROTECTED]

This happens when there is no message catalog associated
with the event source in the registry.
The solution is to add an appropriate message catalog to
the win32 project, and enter the details into the registry
when PHP is installed.

However, this won't solve the case where the syslog is
opened with alternative message sources (such as c-client),
since each message source would need to be registered also.

------------------------------------------------------------------------

[2003-10-07 11:38:20] rick_g22 at yahoo dot com

I get this error on WinXP SP2, using PHP 4.3.3 and Apache 2.0.47. It's
not bogus, certainly.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/8314

-- 
Edit this bug report at http://bugs.php.net/?id=8314&edit=1

Reply via email to