composer 安装phpspreadsheet 总是报错,看不懂到底哪里问题

`Your requirements could not be resolved to an installable set of packages.

Problem 1

- Installation request for phpoffice/phpspreadsheet ^1.9 -> satisfiable by phpoffice/phpspreadsheet[1.9.0].
- phpoffice/phpspreadsheet 1.9.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.

Installation failed, reverting ./composer.json to its original content.`

阅读 10.1k
3 个回答

需要安装zip扩展

#wget https://pecl.php.net/get/zip-1.15.5.tgz
#tar zxfv zip-1.15.5.tgz

#cd zip-1.15.5

#/usr/local/php/bin/phpize

#./configure --with-php-config=/usr/local/php/bin/php-config

#make

#make install

安装完成后修改一下php.ini

#vi /usr/local/php/etc/php.ini

加入

extension=zip.so

然后重启php-fpm

没装过, 不过 按照报错的意思是 你的PHP环境没有安装 zip扩展 , 这个包需要 zip扩展吧!

缺少必要的扩展,pecl下载一个就好了,zip扩展还需要其它依赖,安装的时候看安装过程中报的错误去百度一查一个准

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题