ZipArchive Library Is Not Enabled When Using PHPExcel

余生长醉 提交于 2019-12-05 10:17:48

For writing, PHPExcel does provide PCLZip as an alternative to ZipArchive. You can configure it to use this by calling

PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);

But if you want to read any of the zipped spreadsheet file formats (e.g. xlsx, ods) then you do need PHP's zip archive extension enabled

EDIT

With effect from version 1.8.0, the PCLZIP option is now available when reading zipped formats as well as for writing them

ZipArchive is a requirement for PHP Excel. You need to follow the install instructions for it to enable it on your production server.

It is already enabled on your development server, reason why it works there. Contact your host to see if it is already compiled, and if so how to enable it for your account.

Uncommenting the PECL extension from php.ini would enable it. Contact your host to have it enabled if you do not have access to the file.

Linda

Requirements

PHP version 5.2.0 or higher
PHP extension php_zip enabled *)
PHP extension php_xml enabled
PHP extension php_gd2 enabled (if not compiled in)

When upgrading to PHP 7, you should make sure to install the PHP 7 versions of you libraries as well. The PPA providing PHP 7 also provides a php7.0-zip package. You can install it with:

$ sudo apt-get install php7.0-zip

To see additional PHP 7 libraries that are available, run:

$ sudo apt-cache search php7.0-*

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!