I'm setting up locales so that I can later use PHP's strftime function to output date strings correctly according to a user's language.
echo setlocale(LC_ALL, $code.'.UTF8') ? $name : 'Failed to set to '.$name;
(variables are set, this is just an exerpt)
When run from the command line, the script works, sets the locale and later outputs the day and month names in the correct language through strftime.
When run from a webpage (powered by Apache), the script fails to set the locale.
The server is running Debian. The odd thing is, the same script works properly from both cil and apache in another, local Debian box. Language packs were installed on both machines using apt-get install locales-all.
Is there a setting somewhere that could be causing the locale setting to fail on the live box?
locale -areturn? Does it show the locale you are trying to set? – Rob Jun 15 '11 at 14:18