【问题标题】:Compile and install php5.4, make: *** [libphp5.la] Error 1编译安装php5.4,make: *** [libphp5.la] 错误1
【发布时间】:2015-08-06 04:13:42
【问题描述】:

我正在尝试使用以下构建配置构建 PHP:

./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/include/libxml2/libxml --enable-xml  --enable-sockets --with-apxs2=/usr/local/httpd/bin/apxs --with-mcrypt  --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2=/usr/bin/bzip2  --enable-maintainer-zts

然后运行make。在构建过程中的某个时刻,我得到:

/usr/bin/ld: /usr/local/lib/libbz2.a(bzlib.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libbz2.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1

关于我的系统的一些信息:

[root@localhost php-5.4.41]# rpm -qa|grep libxml
libxml2-devel-2.7.6-17.el6_6.1.x86_64
libxml2-2.7.6-17.el6_6.1.x86_64
[root@localhost php-5.4.41]# rpm -qa|grep  libtool
libtool-ltdl-devel-2.2.6-15.5.el6.x86_64
libtool-ltdl-2.2.6-15.5.el6.x86_64
libtool-2.2.6-15.5.el6.x86_64
[root@localhost php-5.4.41]# rpm -qa|grep bzip
bzip2-1.0.5-7.el6_0.x86_64
bzip2-libs-1.0.5-7.el6_0.x86_64

谁能帮帮我?

【问题讨论】:

  • 这看起来很像尝试再次编译一个非 64 位库。/usr/local/lib/libbz2.a
  • 是的,我编译的bzip2方法是错误的。正确的做法是“make -f xxx.so”

标签: php centos redhat lamp build-error


【解决方案1】:

这看起来很像尝试再次编译一个非 64 位库。 /usr/local/lib/libbz2.a 似乎不是 libbz2 的正确位置(通常系统库安装在 /usr/lib 中)。它是如何安装的?

【讨论】:

  • 感谢您的回答,我重新编译了bzip2,php可以正常运行了。我开始编译bzip2的方法是错误的,因为我直接使用了“make”。在使用“make”之前,你应该初始化“make -f xxx.so”。
猜你喜欢
  • 2014-11-26
  • 1970-01-01
  • 2013-02-23
  • 1970-01-01
  • 2017-10-24
  • 1970-01-01
  • 1970-01-01
  • 2016-04-07
  • 1970-01-01
相关资源
最近更新 更多