ddxiami

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3013|回复: 0

[调试] 编译PHP7.4.6报错configure: error: Package requirements (libzip >= 0.11)...

[复制链接]
发表于 2021-4-16 11:58:05 | 显示全部楼层 |阅读模式
原文地址:https://blog.csdn.net/jiluz/article/details/105641287

当前环境
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.
1
2
3
4
5
6
7
8
9
10
11
12
13
解决
姿势一(方便)
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum —enablerepo=remi install libzip5-devel
1
2
姿势二(知道咋回事)
编译安装,指定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
1
2
3
4
5
6
7
8
装完了之后找一下/usr/local/lib下有没有pkgconfig目录,有的话执行命令export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"指定PKG_CONFIG_PATH。
到这里问题解决!
————————————————
版权声明:本文为CSDN博主「人要成长」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/jiluz/article/details/105641287


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|技术文档库 ( 闽ICP备15017263号-2 )|网站地图

GMT+8, 2025-5-18 20:19 , Processed in 0.034547 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表