1. 解决 SSL 下载问题可以尝试以下替代方案下载 libzip:bash# 使用国内镜像或GitHub下载wget https://github.com/nih-at/libzip/releases/download/v1.9.2/libzip-1.9.2.tar.gz# 或使用curlcurl -LO https://github.com/nih-at/libzip/releases/download/v1.9.2/libzip-1.9.2.tar.gz2. 手动编译安装 libzipbash# 下载(使用上述替代方法)wget https://github.com/nih-at/libzip/releases/download/v1.9.2/libzip-1.9.2.tar.gz# 解压tar -xzf libzip-1.9.2.tar.gzcd libzip-1.9.2# 创建构建目录mkdir buildcd build# 配置并编译cmake ..makesudo make install# 更新库缓存sudo ldconfig3. 强制指定 libzip 路径重新编译 PHP 扩展bash# 回到PHP Zip扩展目录cd /www/server/php/74/src/ext/zip/# 重新执行phpize/www/server/php/74/bin/phpize# 手动指定libzip路径./configure --with-php-config=/www/server/php/74/bin/php-config \ --with-libzip=/usr/local/lib# 编译并安装makesudo make install4. 验证安装bash# 检查libzip版本pkg-config --modversion libzip# 应显示1.9.2或更高版本5. 启用 PHP 扩展bash# 编辑PHP配置文件vi /www/server/php/74/etc/php.ini# 添加或确保以下行存在extension=zip# 保存并退出后重启PHP和Web服务器service php-fpm restartservice nginx restart # 或 service httpd restart
https://www.doubao.com/thread/w3baa2cb1f921bb23 豆包链接
|
|