php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2652 PHP changes locale at start of request -> Apache logs mangled
Submitted: 1999-11-02 03:47 UTC Modified: 1999-11-02 04:57 UTC
From: gordon+php at vip dot fi Assigned:
Status: Closed Package: Other
PHP Version: 3.0.12 OS: Linux 2.2.5-15smp
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gordon+php at vip dot fi
New email:
PHP Version: OS:

 

 [1999-11-02 03:47 UTC] gordon+php at vip dot fi
It seems that PHP is changing the locale at the start of each request that is passed to the module, thus mangling the Apache logs by inserting the name of the month of the current locale. From a human standpoint this is not a very big problem per se, but log analyzers like Analog and WebTrends choke on the lines that have the localised month name. A quick fix is to put setlocale(LC_ALL,"C") at the beginning of the function multi_log_transaction in Apache's mod_log_config, but I think the problem should be solved by modifying PHP. In bug report #404 Zeev comments that if PHP is modified to set the locale again at the end of each request a lot of overhead is created - but how else to counter the problem?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-02 04:57 UTC] jah at cvs dot php dot net
Are you sure you don't set locale somewhere in your scripts? The only locale
setting that PHP touches is LC_CTYPE at module startup, and it's initialised
from environment. By the way, what is the environment when you start
Apache...?

Also, current CVS version already does setlocale(LC_ALL, "") at the end of
request if the script changed any locale settings.

Closing, because the problem seems to be not caused by PHP or if it is PHP
not restoring changed settings, it is already fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 17:01:33 2024 UTC