setlocale Apache/PHP problem - tentative bug.
| From: | Christian Reis | Date: | Wed, 06 Oct 1999 22:20:52 +0000 |
| Subject: | setlocale Apache/PHP problem - tentative bug. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-11586@lists.php.net to get a copy of this message | ||
I'm not saying 'BUG' yet, but..
We're using multiple locales here - and we're having a heap of trouble.
I'm isolating the problem to either Apache or PHP, but I'm asking first to
know if anybody's done the same, and then inviting anyone to test for the
same error.
This is php-3.0.12 both DSO and static on apache-1.3.9.
I've seen this problem on apache-1.3.6, php-3.0.11.
I infer the problem is:
setlocale is [cached,kept] over a session on the httpd process that ran.
I setlocale("LC_ALL","pt_BR") on a certain page. Execution goes fine and I
can use by brazilian date names fine.
I then open another _totally unrelated_ page. There is _no_ setlocale
statement in the page's script; a simple strftime. I assume the locale
should be "C" - the default locale. I'm running httpd with no LANG
environment variable set.
This is the interesting part:
- _OCCASIONALLY_, we get brazilian date names. This is quite
reproducible, but happens erraticly. I _THINK_ this is because we're being
run by the httpd daemon that executed the setlocale previously. I say
_THINK_ because if I issue no setlocale ever (since apache's startup) I
never get the changed locale. I've echoed the locale onto a page and it's
really set to pt_BR sometimes, and C others.
Known problem?
k