[imp] IMP + gettext on Solaris

Mariusz Zynel mariusz@math.uwb.edu.pl
Sat, 29 Jun 2002 20:14:07 +0200


Hi List,

This topic floats around on this list for quite a long time. I think
I know where the problem lies now. 

gettext() is implemented in both libc and libintl libraries. The later
is linked or not against php. Anyway libc code has precedence. Even
if one links libintl statically into php, it won't work. The solution
is to link both httpd and php statically with libintl, or use
LD_PRELOAD. The first solution is known to work, as my IMP mailing
list archive says. The later I've just tried and works nice even
better as you do not need to rebuild all the stuff. How to use it?

  LD_PRELOAD=libintl.so /etc/init.d/apache start

or 

  LD_PRELOAD=libintl.so apachectl start

I've put LD_PRELOAD into /etc/init.d/apache for convenience.
man ld.so.1 for more details on LD_PRELOAD.

libintl.so should be a GNU library in the directory compiled
into http and php with -R option. /usr/lib is such a default path.

Well it doesn't suffices for Horde 2.1/IMP 3.1. To make languages
working I had to add LC_MESSAGES to horde/lib/Lang.php as follows:

        $GLOBALS['language'] = $lang;
        putenv('LANG=' . $lang);
        putenv('LANGUAGE=' . $lang);
	putenv('LC_MESSAGES=' . $lang);
        setlocale(LC_ALL, $lang);

Hope this will save some headaches for Solaris users

-- 
        .
Mariusz Zynel         University of Bialystok, Institute of Mathematics
                                 Akademicka 2, 15-267 Bialystok, Poland
-----------------------------------------------------------------------
mailto:mariusz@math.uwb.edu.pl                office: +48 (85) 745 7552
http://math.uwb.edu.pl/~mariusz               mobile: +48 (604) 777 588