0

I would like to use setlocale with "es_ES". It returns false, but other languages like "de_DE" are working fine.

So I checked "locale -a" on the server (Red Hat 4.4.6-4 ). It's on the list. When I use the following code in PHP it is not in the list:

<?php echo system('locale -a'); ?>

It returns different results then the server. Any ideas, how to add es for using the locale in PHP?

I am using Apache 2.2.15.

1 Answers1

-1

First try it again after you restart the apache2 server!!

I am using apache on ubuntu. I can specify this in the /etc/apache2/envvars file, along with the PATH and other environment variables.

You should reload the HTTP server configuration files. (eg service apache2 reload)

bni i
  • 103
  • 7
  • You can specify the installed locales in an environment variable...!? – deceze Dec 16 '15 at 12:30
  • I think it isn't recommended, but that wasn't point. The point is to change to a different installed locale. – bni i Dec 16 '15 at 12:32
  • Well, no, seriously: if there's an environment variable that can change the output of `locale -a`, by all means please tell us in detail. – deceze Dec 16 '15 at 12:33
  • $ cat /etc/apache2/envvars ... ## The locale used by some modules like mod_dav export LANG=C ## Uncomment the following line to use the system default locale instead: #. /etc/default/locale export LANG – bni i Jul 13 '16 at 10:03