wxyfj 发表于 2018-11-23 11:19:35

Apache编译安装:/usr/lib/libexpat.so: could not read symbols解决方法

  编译apache或者apache出品的log4cxx等软件时,有可能报"/usr/lib/libexpat.so: could not read symbols: File in wrong format"这个错误
  出现这个问题,主要原因是libexpat的兼容性,特别对是64bit服务器的兼容性。现在新的服务器基本都采用64位了,但是默认的/usr/lib/库是32位的,64位的库默认在/usr/lib64/目录下,所以编译64位软件会遇到不少问题。
  下面介绍一些解决思路:
  陈运文
  1)最直接的方法:
  cp /usr/lib64/libexpat.* /usr/lib/
  (将/usr/lib64/目录下的 libexpat.a、libexpat.la   libexpat.so 文件拷贝到/usr/lib/目录)
  cp覆盖以后,make就可以了
  2)configure里手工指定库文件路径
  ./configure LDFLAGS="-L/usr/lib64 -L/lib64" --prefix=/usr/local/apache --enable-so --enable-expires --enable-rewrite --enable-headers --enable-deflate --enable-dav --enable-maintainer-mode
  3)另一种设置configure的办法是,将configure更改为:
  ./configure –enable-lib64 -libdir=/usr/lib64 –enable-ssl –with-ssl=/usr/local/ssl –enable-module=so –prefix=/usr/local/apache
  4)方法四:编译时增加编译参数--with-expat=builtin
  之前介绍了,由于64位服务器下编译脚本在定位系统 expat支持时有些问题。使用自带的expat来编译,也可以解决这个问题了。方法如下:
  # ./configure --prefix=/usr/local/apache2 --enable-modules=so--enable-rewrite --with-expat=builtin

页: [1]
查看完整版本: Apache编译安装:/usr/lib/libexpat.so: could not read symbols解决方法