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.`

最佳答案

需要安装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