Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to display a date in french locale.
A solution is to use setlocale(LC_TIME, 'fr_FR');
But I'm looking to set the locale directly in the configuration of my apache server.
In the /etc/httpd/conf/httpd.conf file, I tried

<VirtualHost *:80>
    ...
    SetEnv LC_TIME 'fr_FR'
</VirtualHost>

without any effect.
In which php or apache configuration file should I define the LC_TIME variable?

share|improve this question
    
What happens if you read out the locale after setting it through apache? Also, a few people commented on the settings page that you should specify a charset along with the locale. –  Daniel Williams Aug 19 at 22:15

2 Answers 2

The httpd.conf file is not typically used to set this parameter. Instead, you will want to edit the /etc/php.ini file and set the timezone in date.timezone:

Europe/Paris

Timezone information can be found on the PHP website http://www.php.net/manual/en/timezones.europe.php

Remember to restart Apache once the changes are made if you are not using PHP-FPM.

share|improve this answer
    
Unfortunately timezone doesn't manage the locale for date (language for date) neither the LC_TIME variable. –  Nicolas May 26 '13 at 23:53
    
    
Thanks for the link, but it doesn't answer to my question. I look for a configuration file to set the locale. –  Nicolas May 27 '13 at 10:21

There is an existing Apache extra module that could solve your issue : https://code.google.com/a/apache-extras.org/p/mod-setlocale/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.