phpspreadshee读excel,安装zip扩展

phpspreadshee读excel,安装zip扩展

 

问题:

vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Reader\Xlsx.php : 81 行报错。

ZipArchive 类不存在

 

安装:

wget http://pecl.php.net/get/zip
tar -zxvf zip
cd zip-1.x.x
phpize
./configure
make
sudo make instal

注意 phpize 路径、php-config 路径

./configure –with-php-config=/path/to/php-config

 

 

执行configure 报错

fatal error: zipconf.h: No such file or directory

解决:

find /usr/local -iname ‘zipconf.h’

ln -s /usr/local/lib/libzip/include/zipconf.h /usr/local/include/

然后重新执行编译步骤

 

make:

https://www.cnblogs.com/mmykdbc/p/13993293.html