# [EMAIL PROTECTED] / 2006-11-03 16:16:11 +0100:
> Roman Neuhauser wrote:
> > # [EMAIL PROTECTED] / 2006-11-03 14:51:39 +0100:
> >> 1. running the command 'locale -a' returns the following [shortened] list:
> >>
> >> C
> >> de_DE
> >> dutch
> >> en_GB
> >> nl_NL
> >> [EMAIL PROTECTED]
> >> nl_NL.iso88591
> >> [EMAIL PROTECTED]
> >> nl_NL.utf8
> >> [EMAIL PROTECTED]
> >> POSIX
> >>
> >> 2. running the following from the commandline returns "en_GB" (meaning
> >> the locale was set correctly)
> >>
> >> php -r 'var_dump(set_locale(LC_ALL, "en_GB"))';
> >>
> >> 3. running the same code via the webbrowser (it is Apache2 and yes I
> >> have restarted it!) always returns FALSE (meaning the locale was not
> >> set correctly)
> >
> > what happens if you run locale -a from apache?
>
> ah, I did check this. doing <?php system('locale -a'); ?> in a webpage
> produces the same list as running it on the commandline.
ok then
> >> in fact I can set any installed locale I want on the commandline BUT
> >> trying to set any other than the originally installed "[EMAIL PROTECTED]"
> >> in
> >> code running via Apache results in FALSE being returned and the locale
> >> not being set.
> >>
> >> has anybody got a clue for me?
> >
> > You don't mention what warning(s) the failing setlocale() call produces.
>
> it just returns false, telling me that the chosen locale(s) was/were not set
> - there
> is no PHP error at all.
I just checked the setlocale() code (in HEAD), and surely it can
return false without a warning, it can even be an almost empty (and
just as quiet) stub that just returns false, depending on the value
of HAVE_SETLOCALE during compilation.
So, before you go off recompiling mod_php with a few printf() and
perror() calls here and there, you should find out whether it's PHP
or Apache that makes the call fail. Try a simple CGI script, does
locale manipulation succeed there?
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php