[实践OK]centos7.6安装php7.3.12出现configure: error: Please reinstall the libzip distribution的解决办法。CentOS6安装非官方memcache-4.0.5出现 Autoconf version 2.64 or higher is required。

jackxiang 2019-12-17 10:25 | |
#mv libzip.so.5 /tmp/.
mv: overwrite ‘/tmp/./libzip.so.5’? y

[root@rpmbuild_server_bj_yz_10_10_0_158:/usr/local/libzip/lib]
#ls
libzip  libzip.a  libzip.la  libzip.so  libzip.so.5.0.0  pkgconfig

[root@rpmbuild_server_bj_yz_10_10_0_158:/usr/local/libzip/lib]
#ls
libzip  libzip.a  libzip.la  libzip.so  libzip.so.5.0.0  pkgconfig

[root@rpmbuild_server_bj_yz_10_10_0_158:/usr/local/libzip/lib]
#ldconfig  -v|grep libzip
ldconfig: Can't stat /libx32: No such file or directory
ldconfig: Path `/usr/lib' given more than once
ldconfig: Path `/usr/lib64' given more than once
ldconfig: Can't stat /usr/libx32: No such file or directory
/usr/local/libzip/lib:
        libzip.so.5 -> libzip.so.5.0.0 (changed)

=========================================
CentOS 7编译安装PHP 7.4提示 libzip 版本问题:
https://blog.csdn.net/tan88881111/article/details/121599297

报错提示非常明显,配置程序没有找到libzip库,你用yum安装libzip-devel的话,安装的版本是0.10,版本达不到要求。所以,此时我们需要卸载掉yum安装的libzip然后手动安装新版。
/usr/local/libzip/lib:
        libzip.so.5 -> libzip.so.5.0.0

[root@rpmbuild_server_bj_yz_10_10_0_158:/tmp/php-7.3.16]
#cd /usr/local/libzip/lib

[root@rpmbuild_server_bj_yz_10_10_0_158:/usr/local/libzip/lib]
#ls
libzip  libzip.a  libzip.la  libzip.so  libzip.so.5  libzip.so.5.0.0  pkgconfig


checking libzip... yes

Please reinstall the libzip distribution
checking for libzip... not found
configure: error: Please reinstall the libzip distribution

vim ./configure
追踪$LIBZIP_LIBDIR,发现它是一个lib库:
  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$LIBZIP_LIBDIR
    "

再向上查找:


再向上找这个LIBZIP_LIBDIR变量的来源:





checking libzip... =================
echo $LIBZIP_LIBDIR



PHP旧版本,我这编译php55/   php56/   php7/   php71/  php72/ 都没有出现这个问题,php73出现了这个问题。


configure: error: Please reinstall the libzip distribution
rpm -ql libzip-devel|grep -v man
/usr/include/zip.h
/usr/include/zipconf-64.h
/usr/include/zipconf.h
/usr/lib64/libzip
/usr/lib64/libzip.so
/usr/lib64/libzip/include
/usr/lib64/libzip/include/zipconf.h
/usr/lib64/pkgconfig/libzip.pc
出现:
configure: error: Please reinstall the libzip distribution

于是:
yum install -y libzip-devel

编译PHP时出现新问题:
checking for libzip... configure: error: system libzip must be upgraded to version >= 0.11
error: Bad exit status from /root/rpmbuild/tmp/rpm-tmp.gsrSs0 (%build)
经过源码安装是最新的版本,解决办法:


再重新编译PHP7.3,后终于成功完成编译。


cat /usr/local/lib/pkgconfig/libzip.pc


find /usr/local/include/ -name "zip.h"
/usr/local/include/zip.h

rpm -qf /usr/local/include/zip.h
file /usr/local/include/zip.h is not owned by any package

rpm -qf /usr/local/include/zipconf.h
file /usr/local/include/zipconf.h is not owned by any package


ldd /usr/local/php/bin/php |grep libzip   #php 7.3.12
        libzip.so.5 => /usr/local/lib/libzip.so.5 (0x00007f3be1b38000)

旧的php,PHP 7.1.6,无任何返回:ldd /usr/local/php/bin/php |grep libzip


以上实践摘取自 :https://www.php.cn/php-weizijiaocheng-414091.html
https://blog.csdn.net/liuyeluoqing/article/details/81697954
https://blog.qzze.com/820.html


CentOS6.X上rpmbuild  -ba memcache-php73-4.0.5.el6.x86_64.spec
出现error: Autoconf version 2.64 or higher is required  :
https://blog.51cto.com/11736068/2110670

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/10369/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: jackxiang 编辑于2022-3-10 00:01
评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]