宝塔面板安装PHP7.3出现PHPZIP丢失的解决方法

436阅读
0评论
0点赞

原因回顾:

早期安装的Php7.3是独立编译zip扩展,后续安装及升级是整合编译的,导致升级后会重复加载zip模块.

为避免这个错误.

后面的PHP就不再单独编译ZIP扩展了。

然后呢,PHP  7.3.8,ZIP 模块不再整合了,在面板配置中却没有安装ZIP扩展的选择。

这样新安装php7.3就会出现phpzip丢失的问题

但是,ZIP扩展本来就包含在软件包里,解决这个问题,只需要手动进行添加即可.

cd /www/server/php/73/src/ext/zip/
/www/server/php/73/bin/phpize
./configure --with-php-config=/www/server/php/73/bin/php-config
make && make install

安装好zip扩展,还需要在PHP配置文件中启用.

在php.ini中添加这一行:

extension = zip.so

然后重启php7.3即可.


遇到问题

libzip不支持或未安装

安装libzip,即可解决

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


zipconf.h找不到

添加软连接,即可解决
ln -s /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h

https://thinkct.oss-cn-beijing.aliyuncs.com/storage/default/20230917/QQ图片202104282030a3b3e0157c8c12020d822f50e3a958f865b7643.png" alt="" data-href="https://thinkct.oss-cn-beijing.aliyuncs.com/storage/default/20230917/QQ图片202104282030a3b3e0157c8c12020d822f50e3a958f865b7643.png" style=""/>

评论(0)
暂无评论,期待您的发言...
发表评论