Author |
|
rockjock
Joined: 25 Mar 2011 Posts: 8
|
Posted: Mon 05 Mar '12 19:42 Post subject: Apache 2.4.1, mod_fcgid 2.3.7 and PHP localeconv() |
|
|
localeconv() returns the correct result when running PHP as an Apache module:
Code: | array(18) {
["decimal_point"]=>
string(1) "."
["thousands_sep"]=>
string(1) ","
["int_curr_symbol"]=>
string(3) "USD"
["currency_symbol"]=>
string(1) "$"
["mon_decimal_point"]=>
string(1) "."
["mon_thousands_sep"]=>
string(1) ","
["positive_sign"]=>
string(0) ""
["negative_sign"]=>
string(1) "-"
["int_frac_digits"]=>
int(2)
["frac_digits"]=>
int(2)
["p_cs_precedes"]=>
int(1)
["p_sep_by_space"]=>
int(0)
["n_cs_precedes"]=>
int(1)
["n_sep_by_space"]=>
int(0)
["p_sign_posn"]=>
int(3)
["n_sign_posn"]=>
int(0)
["grouping"]=>
array(1) {
[0]=>
int(3)
}
["mon_grouping"]=>
array(1) {
[0]=>
int(3)
}
}
|
However, when run using mod_fcgid, localeconv() returns:
Code: | array(18) {
["decimal_point"]=>
string(1) "."
["thousands_sep"]=>
string(0) ""
["int_curr_symbol"]=>
string(0) ""
["currency_symbol"]=>
string(0) ""
["mon_decimal_point"]=>
string(0) ""
["mon_thousands_sep"]=>
string(0) ""
["positive_sign"]=>
string(0) ""
["negative_sign"]=>
string(0) ""
["int_frac_digits"]=>
int(127)
["frac_digits"]=>
int(127)
["p_cs_precedes"]=>
int(127)
["p_sep_by_space"]=>
int(127)
["n_cs_precedes"]=>
int(127)
["n_sep_by_space"]=>
int(127)
["p_sign_posn"]=>
int(127)
["n_sign_posn"]=>
int(127)
["grouping"]=>
array(0) {
}
["mon_grouping"]=>
array(0) {
}
}
|
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 05 Mar '12 20:10 Post subject: |
|
|
Since PHP is not connected directly to apache it can't grab its local env variables.
What is it that you need from that array that you can't get anywhere else? |
|
Back to top |
|
admin Site Admin
Joined: 15 Oct 2005 Posts: 692
|
Posted: Mon 05 Mar '12 21:09 Post subject: |
|
|
rockjok replied in a new post:
I have an i18n/l10n-aware application that requires the contents of the entire array. I don't think Apache's SetEnv will solve the problem either, considering the dynamic nature by which my app uses setlocale() at different times during execution. |
|
Back to top |
|
angosso.net
Joined: 28 Jan 2011 Posts: 2 Location: Creteil
|
Posted: Wed 07 Mar '12 17:10 Post subject: Local? |
|
|
What utility for local.
Bug the script in php directely |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 07 Mar '12 18:12 Post subject: |
|
|
Since you already know the content of that array and I think it won't change that much, why not fill a regular array with that values? |
|
Back to top |
|
rockjock
Joined: 25 Mar 2011 Posts: 8
|
Posted: Sun 11 Mar '12 0:26 Post subject: |
|
|
Hard coding is not an option because it's not a scalable solution. |
|
Back to top |
|