PHP72 Class 'ZipArchive' not found 解决方法

问题描述

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Class 'ZipArchive' not found

问题原因

缺少zip包

解决方法

安装zip包,设置php.ini文件的zlib.output_compression = On。

pecl 安装

  • pecl install php72-zip

源码安装

  • 下载扩展包: wget http://pecl.php.net/get/zip-1.13.5.tgz
  • 解压: tar -zxvf zip-1.13.5 && cd zip-1.13.5
  • 编译安装: make && make install
  • 查找php.ini文件: find / -name "php.ini"
  • 编辑文件:vim php.ini,添加如下行:
extension="/usr/lib64/php/modules/zip.so"

zlib.output_compression = On // 原来是Off, 修改为On
发布了59 篇原创文章 · 获赞 0 · 访问量 2731

猜你喜欢

转载自blog.csdn.net/ClassmateLin/article/details/104390791