Loading... 使用宝塔环境安装升级到php7.4后,发现没有安装zip扩展,通过网上搜索后,通过如下步骤解决: ### 安装libzip ``` 先删除旧版本 yum remove zip #下载编译安装 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 && make install ``` 安装完成后,查看是否存在/usr/local/lib/pkgconfig目录,如果存在,执行如下命令来设置PKG_CONFIG_PATH: ``` export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" ``` ### 安装ZipArchive ``` cd /www/server/php/74/src/ext/zip /www/server/php/74/bin/phpize ./configure --with-php-config=/www/server/php/74/bin/php-config make && make install echo "extension = zip.so" >> /www/server/php/74/etc/php.ini ``` 重启php即可(有时候重启无效,建议重启服务器,再查看状态) <hr class="content-copyright" style="margin-top:50px" /><blockquote class="content-copyright" style="font-style:normal"><p class="content-copyright">版权属于:大漠孤狼</p><p class="content-copyright">本文链接:<a class="content-copyright" href="https://www.dmgls.com/1280.html">https://www.dmgls.com/1280.html</a></p><p class="content-copyright">转载时须注明出处及本声明</p></blockquote> Last modification:December 14th, 2021 at 10:38 pm © 允许规范转载 Support 如果觉得我的文章对你有用,请随意赞赏 Appreciate the author