Just another issue concerning dates. In my localhost, my dates works fine in French. On servor, it appears in English, I don’t know how to fix it, and it’s a big problem for me.
I’m using Bastian’s calendar with this config
setlocale (LC_TIME, 'fr_FR.utf8','fra');
And in my config.php I did multiple times settings like this :
LC_COLLATE => 'fr_FR.utf8',
LC_MONETARY => 'fr_FR.utf8',
LC_NUMERIC => 'fr_FR.utf8',
LC_TIME => 'fr_FR.utf8',
LC_MESSAGES => 'fr_FR.utf8',
LC_CTYPE => 'fr_FRs.utf8',
What is very weird is everything works fine locally but not on server
Is the language installed on the server?
Here’s a small guide for Ubuntu/Debian distros.
The website is on OVH, and I don’t think OVH needs any language installation. (I didn’t find any documentation about this).
But here is another clue : I have copied/pasted all the files of the site into another OVH server and this time, the site is displayed in french, like it have to be.
I’m a bit lost about this issue, but I’m still supposing it comes from the server. How can I fix it ?
Do you have SSH access to the servers? If I recall correctly, OVH are mostly a dedicated server and VPS provider. If that’s the case, I doubt OVH has documentation on language installation as the method differs between OSes, regardless of the host. By default most Linux distributions have
en_US.utf8 and other variants of
When you use date functions like
strftime, PHP gets the month, weekday strings from the server. The server doesn’t know
Mercredi unless you have the languages installed.
I actually have access to the SSH. I’ve never done that before, it makes me a little scared. How am I supposed to change to
fr_FR.uft8 ? What is the command line to write?
Do you think a
<? phpinfo(); ?> file could be usefull ?
What do you get if you type
in the command line on the server?
You don’t need to do anything complicated. Assuming you’re on Ubuntu, first think you can do, is connect to the offending server via SSH an use the command:
This should list all of the installed languages. Check if fr_FR.utf8 is listed.
If it’s not, you can run:
sudo apt-get install language-pack-fr
to install it.
Yes, when I type
locale -a I can see that
You could try another syntax:
May 10, 2017, 3:39pm
Doesn’t change anything.
fr_FR.iso88591 (just trying)
I’m really starting to worry, especially with these possible solutions that do not work.
I assure you I put exactly the same files on another OVH server and that it works in French.
Hm, the website you linked to has English month names?
At least in the sidebar and at the top…
May 10, 2017, 6:00pm
Ok, I see a totally different thing, from my point of view, the month’s name are in French, and the header too.
How can this be possible ?
For example, in the horizontal header ticker, the code is
<?php if($date = param('date')): ?>
$datefr = strftime("%A %e %B %Y",strtotime($date)); ?>
<span class="jourferie">La Tôlerie est fermée ce jour </span><?php echo $datefr ?> <span class="pleinelune">(Les jours de Pleine lune <span class="countpleine"></span>)</span>
<?php else: ?>
<span class="jourferie">La Tôlerie est fermée ce jour </span><span class="aujour">AUJOURD’HUI, LE </span><?php echo strftime('%e %B %Y') ?><span class="pleinelune">(Pleine lune)</span>
<?php endif ?>
I see the month names in french. What is going on.
FYI: For me they’re displayed in English. Strange!?
May 11, 2017, 8:54am
On top on that, some people reported that they saw the date of June 9 since three days on the home page, while the default today date always worked for me in both URL…
I did a reduced test case with
setlocale (LC_TIME, 'fr_FR');
echo (strftime("%A %d %B"));
Same issue : I see french date locally, english on server.
Have you also tried several options for this simple test, like
May 11, 2017, 10:51am
I immediatly did that. You can see mutiple options in the test page, I get everything in English exept on
matiere-revue.com/test.php, and on local
Again, for me
matiere-revue.com/test.php displays everything in English
Which OS is installed on those servers?
Edit (14:08): Now it is suddenly in French/German/NL
May 11, 2017, 12:42pm
I have called OVH and my server is mutualized, so I can’t change the OS.
Matiere-revue.com and latolerie.fr are running on Linux. You can check every informations you need here
Do you think this is necessarily a server problem?
This is definitely a server settings problem.
By “mutualized” I guess you mean it is shared hosting so that you don’t have root rights?