<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[[实践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。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Tue, 17 Dec 2019 02:25:41 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	#mv libzip.so.5 /tmp/.<br/>mv: overwrite ‘/tmp/./libzip.so.5’? y<br/><br/>[root@rpmbuild_server_bj_yz_10_10_0_158:/usr/local/libzip/lib]<br/>#ls<br/>libzip&nbsp;&nbsp;libzip.a&nbsp;&nbsp;libzip.la&nbsp;&nbsp;libzip.so&nbsp;&nbsp;libzip.so.5.0.0&nbsp;&nbsp;pkgconfig<br/><br/>[root@rpmbuild_server_bj_yz_10_10_0_158:/usr/local/libzip/lib]<br/>#ls<br/>libzip&nbsp;&nbsp;libzip.a&nbsp;&nbsp;libzip.la&nbsp;&nbsp;libzip.so&nbsp;&nbsp;libzip.so.5.0.0&nbsp;&nbsp;pkgconfig<br/><br/>[root@rpmbuild_server_bj_yz_10_10_0_158:/usr/local/libzip/lib]<br/>#ldconfig&nbsp;&nbsp;-v&#124;grep libzip<br/>ldconfig: Can&#039;t stat /libx32: No such file or directory<br/>ldconfig: Path `/usr/lib&#039; given more than once<br/>ldconfig: Path `/usr/lib64&#039; given more than once<br/>ldconfig: Can&#039;t stat /usr/libx32: No such file or directory<br/>/usr/local/libzip/lib:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libzip.so.5 -&gt; libzip.so.5.0.0 (changed)<br/><br/>=========================================<br/>CentOS 7编译安装PHP 7.4提示 libzip 版本问题：<br/><a href="https://blog.csdn.net/tan88881111/article/details/121599297" target="_blank">https://blog.csdn.net/tan88881111/article/details/121599297</a><br/><br/>报错提示非常明显，配置程序没有找到libzip库，你用yum安装libzip-devel的话，安装的版本是0.10，版本达不到要求。所以，此时我们需要卸载掉yum安装的libzip然后手动安装新版。<br/>/usr/local/libzip/lib:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libzip.so.5 -&gt; libzip.so.5.0.0<br/><br/>[root@rpmbuild_server_bj_yz_10_10_0_158:/tmp/php-7.3.16]<br/>#cd /usr/local/libzip/lib<br/><br/>[root@rpmbuild_server_bj_yz_10_10_0_158:/usr/local/libzip/lib]<br/>#ls<br/>libzip&nbsp;&nbsp;libzip.a&nbsp;&nbsp;libzip.la&nbsp;&nbsp;libzip.so&nbsp;&nbsp;libzip.so.5&nbsp;&nbsp;libzip.so.5.0.0&nbsp;&nbsp;pkgconfig<br/><br/><br/>checking libzip... yes<br/><br/>Please reinstall the libzip distribution<br/>checking for libzip... not found<br/>configure: error: Please reinstall the libzip distribution<br/><br/>vim ./configure<br/>追踪$LIBZIP_LIBDIR，发现它是一个lib库：<br/>&nbsp;&nbsp;save_old_LDFLAGS=$LDFLAGS<br/>&nbsp;&nbsp;ac_stuff=&quot;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-L$LIBZIP_LIBDIR<br/>&nbsp;&nbsp;&nbsp;&nbsp;&quot;<br/><br/>再向上查找：<br/><textarea name="code" class="php" rows="15" cols="100">
&nbsp;&nbsp;&nbsp;&nbsp; if test -z &quot;$LIBZIP_LIBDIR&quot;; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#123; $as_echo &quot;$as_me:$&#123;as_lineno-$LINENO&#125;: result: not found&quot; &gt;&amp;5
 $as_echo &quot;not found&quot; &gt;&amp;6; &#125;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; as_fn_error $? &quot;Please reinstall the libzip distribution&quot; &quot;$LINENO&quot; 5
&nbsp;&nbsp;&nbsp;&nbsp; fi
</textarea><br/><br/>再向上找这个LIBZIP_LIBDIR变量的来源：<br/><br/><br/><br/><br/><br/>checking libzip... =================<br/>echo $LIBZIP_LIBDIR<br/><br/><br/><br/>PHP旧版本，我这编译php55/&nbsp;&nbsp; php56/&nbsp;&nbsp; php7/&nbsp;&nbsp; php71/&nbsp;&nbsp;php72/ 都没有出现这个问题，php73出现了这个问题。<br/><textarea name="code" class="php" rows="15" cols="100">
+ 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
</textarea><br/><br/>configure: error: Please reinstall the libzip distribution<br/>rpm -ql libzip-devel&#124;grep -v man<br/>/usr/include/zip.h<br/>/usr/include/zipconf-64.h<br/>/usr/include/zipconf.h<br/>/usr/lib64/libzip<br/>/usr/lib64/libzip.so<br/>/usr/lib64/libzip/include<br/>/usr/lib64/libzip/include/zipconf.h<br/>/usr/lib64/pkgconfig/libzip.pc<br/>出现：<br/>configure: error: Please reinstall the libzip distribution<br/><br/>于是：<br/>yum install -y libzip-devel<br/><br/>编译PHP时出现新问题：<br/>checking for libzip... configure: error: system libzip must be upgraded to version &gt;= 0.11<br/>error: Bad exit status from /root/rpmbuild/tmp/rpm-tmp.gsrSs0 (%build)<br/>经过源码安装是最新的版本，解决办法：<br/><textarea name="code" class="php" rows="15" cols="100">
#先删除旧版本&nbsp;&nbsp;，实践发现旧的PHP版本运行时不需要libzip这个包，新的这个PHP版本才需要的。
yum remove -y libzip-devel libzip&nbsp;&nbsp;&nbsp;&nbsp; #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 &amp;&amp; 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 &#039;/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64&#039;&gt;&gt;/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,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 &lt;zipconf.h&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^
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
</textarea><br/><br/>再重新编译PHP7.3,后终于成功完成编译。<br/><br/><br/>cat /usr/local/lib/pkgconfig/libzip.pc<br/><textarea name="code" class="php" rows="15" cols="100">
prefix=/usr/local
exec_prefix=$&#123;prefix&#125;
libdir=$&#123;exec_prefix&#125;/lib
includedir=$&#123;prefix&#125;/include
libincludedir=$&#123;exec_prefix&#125;/lib/libzip/include

zipcmp=/usr/local/bin/zipcmp

Name: libzip
Description: library for handling zip archives
Version: 1.2.0
Libs:&nbsp;&nbsp;-L$&#123;libdir&#125; -lzip -lz 
Cflags: -I$&#123;includedir&#125; -I$&#123;libincludedir&#125;
</textarea><br/><br/>find /usr/local/include/ -name &quot;zip.h&quot; <br/>/usr/local/include/zip.h<br/><br/>rpm -qf /usr/local/include/zip.h<br/>file /usr/local/include/zip.h is not owned by any package<br/><br/>rpm -qf /usr/local/include/zipconf.h<br/>file /usr/local/include/zipconf.h is not owned by any package<br/><br/><br/>ldd /usr/local/php/bin/php &#124;grep libzip&nbsp;&nbsp; #php 7.3.12<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libzip.so.5 =&gt; /usr/local/lib/libzip.so.5 (0x00007f3be1b38000)<br/><br/>旧的php，PHP 7.1.6，无任何返回：ldd /usr/local/php/bin/php &#124;grep libzip<br/><br/><br/>以上实践摘取自 ：https://www.php.cn/php-weizijiaocheng-414091.html<br/>https://blog.csdn.net/liuyeluoqing/article/details/81697954<br/>https://blog.qzze.com/820.html<br/><br/><br/>CentOS6.X上rpmbuild&nbsp;&nbsp;-ba memcache-php73-4.0.5.el6.x86_64.spec <br/>出现error: Autoconf version 2.64 or higher is required&nbsp;&nbsp;：<br/>https://blog.51cto.com/11736068/2110670<br/>
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践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。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>