couldn't set locale correctly

jablko

Joined: 2004-03-23
Posts: 21
Posted: Tue, 2004-11-02 17:37

I get an internal server error running setup/index.php; presumably because of these errors in the HTTP headers:

Output of script follows:
=====================================================
couldn't set locale correctly
couldn't set locale correctly
couldn't set locale correctly
couldn't set locale correctly
couldn't set locale correctly
couldn't set locale correctly
couldn't set locale correctly
couldn't set locale correctly
ps: no controlling terminal
couldn't set locale correctly
X-Powered-By: PHP/4.3.8
Set-Cookie: PHPSESSID=24c6f5475ee06a71fe5dbe34ea40fffc; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html; charset=ISO-8859-1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
[...]

This is a fresh install; just downloaded 1.4.4-pl2 & followed the installation instructions.

Not sure what is complaining: couldn't set locale correctly

Anyone seen this before?

Thanks!

Jack
----
Give us your Gallery/webserver information to get a faster answer.
Get this information from the PHP diagnostic (in the configuration wizard).
Gallery URL (optional but very useful): http://newcgi.sfu.ca/~jdbates/gallery/setup/index.php
Gallery version: 1.4.4-pl2
Apache version: 2.0.52
PHP version (don't just say PHP 4, please): 4.3.8
Graphics Toolkit:
Operating system: SunOS 5.9
Web browser/version (if applicable):

 
jablko

Joined: 2004-03-23
Posts: 21
Posted: Mon, 2004-11-08 23:15

I tracked the problem down to this line in initLanguage in lib/lang.php:

[...]
// There was previously a != SUNOS check around the LANG= line. We've determined that it was
// probably a bogus bug report, since all documentation says this is fine.
putenv("LANG=". $gallery->language);
[...]

Comment it out & the errors disappear:

[...]
Output of script follows:
=====================================================
ps: no controlling terminal
X-Powered-By: PHP/4.3.8
Set-Cookie: PHPSESSID=f4e4cc0075d273ffa7966ce12b3e1b46; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html; charset=ISO-8859-1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
[...]

Coincidentally, we're running SunOS:

> uname -a
SunOS fraser 5.9 Generic_117171-11 sun4u sparc SUNW,Sun-Fire-V240
>

I can reproduce the problem using the command line:

> sh -c "LANG=en echo foo"
couldn't set locale correctly
foo
>

Probably because the en locale isn't installed:

> locale -a
POSIX
C
iso_8859_1
> sh -c "LANG=C echo foo"
foo
>

Not sure how to solve the problem. A "!= SUNOS check around the LANG= line" is one option, though maybe Gallery should instead check that the locale is installed.

Jack

 
MDeen

Joined: 2005-02-13
Posts: 7
Posted: Sat, 2008-02-02 15:07

I stumbled across this post looking for info on this issue. It seems rather strange to me that this line is still in gallery (I have 1.5.7) after 3 years.

Isn't it time to remove this line?

BTW: I've commented it out and don't get this message anymore. The translations in Gallery seem to be fine.

Maarten