标题:[实践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。 出处:向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除 时间:Tue, 17 Dec 2019 10:25:41 +0000 作者:jackxiang 地址:http://jackxiang.com/post/10369/ 内容: #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 " 再向上查找: if test -z "$LIBZIP_LIBDIR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "Please reinstall the libzip distribution" "$LINENO" 5 fi 再向上找这个LIBZIP_LIBDIR变量的来源: checking libzip... ================= echo $LIBZIP_LIBDIR PHP旧版本,我这编译php55/ php56/ php7/ php71/ php72/ 都没有出现这个问题,php73出现了这个问题。 + cd /root/rpmbuild/BUILD + cd php-7.3.12 + ./configure --prefix=/usr/local/php --with-libdir=lib64 --with-config-file-path=/usr/local/php/etc --with-config-file-scan-dir=/usr/local/php/etc/php.d --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-iconv=/usr/local/libiconv --with-libdir=lib64 --with-zlib --with-ldap --with-ldap-sasl --with-libxml-dir=/usr --with-curl --with-curlwrappers --with-mcrypt --with-gd --with-openssl --with-mhash --with-xmlrpc --without-pear --with-fpm-user=www --with-fpm-group=www --with-gettext --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --enable-mbstring --enable-gd-native-ttf --enable-pcntl --enable-sockets --enable-zip --enable-soap --enable-opcache --enable-exif --enable-mbregex --enable-inline-optimization --enable-ftp --disable-fileinfo --disable-rpath --disable-ipv6 --disable-debug 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) 经过源码安装是最新的版本,解决办法: #先删除旧版本 ,实践发现旧的PHP版本运行时不需要libzip这个包,新的这个PHP版本才需要的。 yum remove -y libzip-devel libzip #yum remove -y libzip #下载编译安装 wget https://nih.at/libzip/libzip-1.2.0.tar.gz tar -zxvf libzip-1.2.0.tar.gz cd libzip-1.2.0 ./configure make && make install 成功源码安装libzip后, 再重新编译PHP7.3又tm出现(为了混口饭吃@开源,忍了。): checking size of off_t... 0 configure: error: off_t undefined; check your library configuration error: Bad exit status from /root/rpmbuild/tmp/rpm-tmp.SYM9DC (%build) configure: error: off_t undefined; check your library configuration #解决方法 默认情况下 centos 的动态链接库配置文件/etc/ld.so.conf里并没有加入搜索路径, 这个时候需要将 /usr/local/lib64 /usr/lib64 这些针对64位的库文件路径加进去。 #添加搜索路径到配置文件 echo '/usr/local/lib64 /usr/local/lib /usr/lib /usr/lib64'>>/etc/ld.so.conf #然后 更新配置 ldconfig -v 再次编译PHP,出现如下编译错误: /usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or dire In file included from /root/rpmbuild/BUILD/php-7.3.12/ext/zip/php_zip.h:31:0, from /root/rpmbuild/BUILD/php-7.3.12/ext/zip/php_zip.c:36: /usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or directory #include ^ ls /usr/local/include/zipconf.h ls: cannot access /usr/local/include/zipconf.h: No such file or directory #解决方法:手动复制过去 cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h 再重新编译PHP7.3,后终于成功完成编译。 cat /usr/local/lib/pkgconfig/libzip.pc prefix=/usr/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include libincludedir=${exec_prefix}/lib/libzip/include zipcmp=/usr/local/bin/zipcmp Name: libzip Description: library for handling zip archives Version: 1.2.0 Libs: -L${libdir} -lzip -lz Cflags: -I${includedir} -I${libincludedir} 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 Generated by Jackxiang's Bo-blog 2.1.1 Release