/usr/lib64/python2.6/libdynload/pyexpat.so: symbol XML_SetHashSalt, version EXPAT_2_0_1_RH not defined in file libexpat.so.1 with link time reference

解决方法:
[root]$cd /usr/lib64/python2.6/lib-dynload
[root]$ln -s /lib64/libexpat.so.1.5.2 libexpat.so.0
[root]$  vim /etc/profile
export LD_LIBRARY_PATH=/usr/lib64/python2.6/lib-dynload:.:/lib64:$LD_LIBRARY    _PATH


RHEL6.5 Input Method出错信息
1.
Exception Value: /usr/lib64/python2.6/lib-dynload/pyexpat.so:
 symbol XML_SetHashSalt, version EXPAT_2_0_1_RH not defined in file libexpat.so.1 with link time reference
https://stackoverflow.com/questions/30630936/reviewboard-symbol-xml-sethashsalt-version-expat-2-0-1-rh-not-defined-in-file



2.
I did notice one thing. The libexpat.so that apache is using points to /usr/local/lib/libexpat.so, and if I run the following on that file I get no results:

(virtualenv)[user@rbdev301 lib]$ strings libexpat.so.1.5.2 | grep XML_SetHashSalt
(virtualenv)[user@rbdev301 lib]$ strings libexpat.so.1.5.2 | grep EXPAT_2_0_1_RH

3.
However, when I check which expat Python is using, I get this:

(virtualenv)[user@rbdev301 lib-dynload]$ ldd pyexpat.so
linux-vdso.so.1 =>  (0x00007ffff252a000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f52afbae000)
libpython2.6.so.1.0 => /usr/lib64/libpython2.6.so.1.0 (0x00007f52af802000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f52af5e4000)
libc.so.6 => /lib64/libc.so.6 (0x00007f52af250000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f52af04c000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007f52aee48000)
libm.so.6 => /lib64/libm.so.6 (0x00007f52aebc4000)
/lib64/ld-linux-x86-64.so.2 (0x00007f52affe3000)


4.
So, python is using the one in /lib64. If I run the same commands on that one, I do get results.

(virtualenv)[user@rbdev301 lib64]$ strings libexpat.so.1.5.2 | grep XML_SetHashSalt
XML_SetHashSalt
(virtualenv)[user@rbdev301 lib64]$ strings libexpat.so.1.5.2 | grep EXPAT_2_0_1_RH
EXPAT_2_0_1_RH

5.
I was able to solve this. I'm not sure if this is the "right" way, but it worked for me. Since I noticed that the libexpat.so.0 symlink in my apache lib dir was pointed at the one in /usr/local/lib and that one did in fact not contain the strings that the error was complaining about, I deleted that symlink and created a new one that pointed at /lib64/libexpat.so.1.5.2, like so:

sudo ln -s /lib64/libexpat.so.1.5.2 libexpat.so.0
Then I restarted the machine and everything works as expected.

Just thought I'd post what solved it for me in case anyone else runs into this weird error.

原文地址:https://www.cnblogs.com/smarkshare/p/10972976.html