Re: libiconv wont work :(
by ikegami (Patriarch) on Dec 06, 2010 at 16:11 UTC
|
In the error message, it says libiconv.so.2. In your report, you said libiconv.2.so. Is that a typo?
| [reply] |
Re: libiconv wont work :(
by moritz (Cardinal) on Dec 06, 2010 at 14:54 UTC
|
How did you install Text::Unaccent? Did the tests pass?
| [reply] |
Re: libiconv wont work :(
by locked_user sundialsvc4 (Abbot) on Dec 06, 2010 at 15:00 UTC
|
| |
|
|
Yeah I used CPAN and it passed...
And I check there are Unaccent.so files in perl modules as well as Unaccent.pm ... This really gives me a headache
| [reply] |
Re: libiconv wont work :(
by Anonymous Monk on Dec 06, 2010 at 16:20 UTC
|
$ ldd /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/aut
+o/Text/Unaccent/Unaccent.so
and
$ strace -f -efiles ldd /usr/lib64/perl5/site_perl/5.8.5/x86_64-linu
+x-thread-multi/auto/Text/Unaccent/Unaccent.so 2>&1 | grep libiconv
say? | [reply] [d/l] [select] |
|
|
yeah it was a typo... (it is of course libiconv.so.2)
the first command outputs:
libiconv.so.2 => not found
libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a95679000)
/lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)
the second one nothing at all... It is missing the link to libiconv.so.2 somehow eventhough it is on the system. I tried
export(LD_LIBRARY_PATH)="/usr/lib:/usr/local/lib"
and running a perl script from cmd line and it worked! But it doesnt work on my "real" website script even if I do ENV{'LD_LIBRARY_PATH'}="/usr/lib:/usr/local/lib" | [reply] [d/l] |
|
|
You have a couple of options. One would be to uninstall your CPAN module, make sure you use your distribution's package manage to install libiconv, then rebuild the CPAN modules so that they will use the OS paths for the libraries.
If you want to use the libiconv that you built yourself, then what you can do (you have to be root to do this) is to add /usr/local/lib to your /etc/ld.so.conf. If you have a Red Hat or Red Hat like system (CentOS, Fedora) then you can simply add a new file in /etc/ld.so.conf.d named anything you want (but in this case usrlocal.conf would be good)with the contents:
/usr/local/lib
Since you want this to work for your web server and Perls spawned by it (I'm guessing Apache), then what you can do is in your httpd.conf specify the environment variable to be passed on using this syntax:
SetEnv LD_LIBRARY_PATH /usr/lib:/usr/local/lib
I only list /usr/lib and /usr/local/lib, but you'll want every path to be included in there, because setting LD_LIBRARY_PATH overrides the complete value used by all programs spawned by the web server (not just Perl). Not specifying everything could lead to Big Problems for CGI executables. | [reply] [d/l] [select] |
|
|
Most likely, changing %ENV is only respected when launching new processes by your OS, and does not affect a currently running process. Either launch your process through a shell script wrapper that sets up the environment, or restart your Perl program by using (something like) exec $0 => @ARGV. The second approach might fail when $0 does not resolve to a valid filename.
| [reply] [d/l] [select] |
|
|
|
|
[pid 20181] open("/lib64/tls/x86_64/libiconv.so.2", O_RDONLY) = -1 ENO
+ENT (No such file or directory)
[pid 20181] open("/lib64/tls/libiconv.so.2", O_RDONLY) = -1 ENOENT (No
+ such file or directory)
[pid 20181] open("/lib64/x86_64/libiconv.so.2", O_RDONLY) = -1 ENOENT
+(No such file or directory)
[pid 20181] open("/lib64/libiconv.so.2", O_RDONLY) = -1 ENOENT (No suc
+h file or directory)
[pid 20181] open("/usr/lib64/tls/x86_64/libiconv.so.2", O_RDONLY) = -1
+ ENOENT (No such file or directory)
[pid 20181] open("/usr/lib64/tls/libiconv.so.2", O_RDONLY) = -1 ENOENT
+ (No such file or directory)
[pid 20181] open("/usr/lib64/x86_64/libiconv.so.2", O_RDONLY) = -1 ENO
+ENT (No such file or directory)
[pid 20181] open("/usr/lib64/libiconv.so.2", O_RDONLY) = -1 ENOENT (No
+ such file or directory)
libiconv.so.2 => not found
| [reply] [d/l] |
|
|
|
|
| [reply] [d/l] [select] |