CentOS编译安装libzip最新版

源自一个错误(安装php扩展: zip)

checking for libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0... no
configure: error: Package requirements (libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0) were not met:

No package 'libzip' found
No package 'libzip' found
No package 'libzip' found
或者是 yum install libzip-devel 完,提示版本过低

解决方案

#依赖
yum install bzip2-devel

cd /usr/local/src
wget https://libzip.org/download/libzip-1.7.3.tar.gz
tar -xvzf libzip-1.7.3.tar.gz 
cd libzip-1.7.3
mkdir build
cd build/
cmake -DCMAKE_INSTALL_PREFIX=/data/apps/libs ..
make && make install

#配置
export PKG_CONFIG_PATH=/data/apps/libs/lib64/pkgconfig:$PKG_CONFIG_PATH
#验证
pkg-config --list-all | grep libzip

感谢阅读这篇文章,如果你喜欢,或者遇到了问题,可以关注我的公众号