php7.4:configure: error: Package requirements (libzip >= 0.11) were not met: No package 'libzip'

当前环境

CentOS Linux release 7.6.1810 (Core)
php 7.4.3

问题

前段时间在个人的服务器上想升级一下php版本,然后就下载编译安装了7.4.3版本。编译时遇到几个No package 'xxx' found,比如No package 'sqlite3' found,只需要网上搜一下安装对应的库就行了,比如对应sqlite3的,执行yum install sqlite-devel就可以了。这里不多赘述,网上搜一下就行了。

但是有个libzip提示版本太低,yum自带的是0.10,网上各种升级安装,源码编译安装都不好用,还是会有相同的提示。

checking whether to enable zend-test extension... no
checking for zip archive read/write support... yes
checking for libzip >= 0.11... no
configure: error: Package requirements (libzip >= 0.11) were not met:

Requested 'libzip >= 0.11' but version of libzip is 0.10.1

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBZIP_CFLAGS
and LIBZIP_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

解决

姿势一(方便)

rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm 
yum —enablerepo=remi install libzip5-devel 

姿势二(知道咋回事)

编译安装,指定PKG_CONFIG_PATH,上面报错中其实有提示信息,让我们考虑调整PKG_CONFIG_PATH环境变量。
下面是详细步骤:

# 先卸载已有
yum remove libzip
# 然后安装
wget https://libzip.org/download/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install

装完了之后找一下/usr/local/lib下有没有pkgconfig目录,有的话执行命令export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"指定PKG_CONFIG_PATH
到这里问题解决!

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值