[solved] Locale

#1
I'm having problems with litespeed and locale settings.

I'm running invision power board and I've got the calendar widget on the homepage that displays the date.

The locale setting is set to en_GB in invision, but it dosn't look like litespeed is working with this, as the date formate is still in the american format of MM/DD/YY

I've spent all day trying to figure it out, even submitting a ticket with cpanel, its definitely something to do with litespeed as if if switch back to Apache, then the date format starts to show properly with the UK format, DD/MM/YY.

Is there a setting or something within litespeed that I've missed.
 
Last edited by a moderator:

NiteWave

Administrator
#2
I think locale setting should be taken care of the php script (invision power board), or lsphp5.

any difference of phpinfo() between apache and lsws ?
 
#3
Not that I can tell,

Its really puzzling, I've built a matching Php binary, but as soon as I switch to Apache it works with the UK format no problem, switch back to litespeed and it goes back the to US format.
 

NiteWave

Administrator
#4
looks it can be customized.

in IP.Board's AdminCP
-> Other Apps
-> Calendar
-> Calendar Settings
-> Time / Date Formatting
-> Date format:
there are 4 choices available:
MM/DD/YYYY
YYYY/MM/DD
DD/MM/YYYY
YYYY-MM-DD
 
#5
looks it can be customized.

in IP.Board's AdminCP
-> Other Apps
-> Calendar
-> Calendar Settings
-> Time / Date Formatting
-> Date format:
there are 4 choices available:
MM/DD/YYYY
YYYY/MM/DD
DD/MM/YYYY
YYYY-MM-DD
Well thats what I thought, but its set right in IPB and I've logged a ticket with them and got the following response:

For the date issue, your language packs are correctly set to en_GB so this means that either the en_GB locale is not correctly installed on your web server or your web host is overriding the locale, possibly via a default PHP setting which is why the British locale / date format is not taking affect. Please pass this on to them and ask them to investigate further.


Like I said if I switch back to Apache it works fine, its jsut when running litespeed as the server that it becomes a problem.

I've read that it might be to do with a chroot setting but looking at the litespeed settings the option for chroot are set to no.
 
#6
I've tried some more tests, just to rule out IPB.

I've uploaded a sample php file with the following in:

PHP:
<?php
setlocale(LC_TIME, "C");
echo strftime("%A");
setlocale(LC_TIME, "fi_FI");
echo strftime(" in Finnish is %A,");
setlocale(LC_TIME, "fr_FR");
echo strftime(" in French %A and");
setlocale(LC_TIME, "de_DE");
echo strftime(" in German %A.\n");
?>
With Apache running I get:

Monday in Finnish is maanantai, in French lundi and in German Montag.

With litespeed running I get:
Monday in Finnish is Monday, in French Monday and in German Monday.
 

NiteWave

Administrator
#7
good test script. I ran it with lsphp5, both on command line and lsws, the result is
Tuesday in Finnish is tiistai, in French mardi and in German Dienstag.
so no problem at my test. can you run it at command line:
#/usr/local/lsws/fcgi-bin/lsphp5 /path/to/test.php
 
#8
well i'm really puzzled by this,

I had to leave it and revert back to our old server as I couldn't figure it out, I thought now xmas and the new year is over I'd revisit it, so have quickly set up a test install and the test script seems to be running fine. So not sure what the problem was. I shall look at making the move back over soon and see if I have the same problem.
 
#9
Right I think I've tracked down the problem, its got something to do with APC, as soon as I install it and turn on the caching does the problem appear again. Not sure why it dosn't seem to like litespeed though as if I switch back to apache with APC still running do the locales work fine again.
 
#12
good point ... then I tried to enable APC, but result is same:
Well I was puzzled by that, so have done some more digging by the process of elimination.

I orginally had a shared memory size of 256m, Its seems that you can set apc.shm_size upto 249M and it works fine, as soon as you go over 250 then the locales stop working.

Really really odd as to why. but at least I know why it wasn't working now, I will just keep my memory size to below 250m, and if i need more I'll have smaller memory sizes but go back to each user having their own memory isntance.
 

NiteWave

Administrator
#13
Its seems that you can set apc.shm_size upto 249M and it works fine, as soon as you go over 250 then the locales stop working.
this suggested me a default setting for lsphp5 external app:

lsws admin console->Server->External App->lsphp5->
Memory Soft Limit (bytes):250M
Memory Hard Limit (bytes):300M

can you increase the soft/hard limit to 300M/350M and see if working for apc.shm_size = 256M ?
 
Top