PHP error ZipArchive library is not enabled

Source: Internet
Author: User
Tags php error ziparchive

The 'ziparchivelibraryisnotenabled workabled und appears when you use the PHPExcel class to read Excel2007.

Detailed error message:

Fatalerror: Uncaughtexception 'exception' withmessage' ZipArchive
Libraryisnotenabled 'in

This is because the PHP zip module is missing. You can install it after receiving it.

WindowsBelow:

Solution:

Open extension = php_zip.dll in the php. ini file.

LinuxBelow:

There is no php_zip.dll file in Linux, so you need to recompile the php zip module.

Wgethttp: // pecl.php.net/get/zip will download the latest one)

Tarzxvfzip-1.x.x.tgz

Cdzip-1.x.x

/Usr/bin/phpize corresponding phpize path find/-namephpize output result/usr/bin/phpize)

./Configure -- with-php-config =/usr/bin/php-config corresponding php-config path)

Make

Makeinstall

If the make process package supportrequiresZLIB. Use -- with-zlib-dir = <DIR> tospecifypre is incorrect, install the dependency package

Yuminstallzlib-devel

2. After the generated module path is installed, the location of zip. so will be displayed on the screen ):

Cd/usr/lib/php/modules/corresponding extensions path/usr/lib/php/modules /)

3. Modify php. ini

Add extension = zip. so or create a zip. ini file in the/etc/php. d/directory and enter extension = zip. so.

Then change zlib. output_compression = Off TO zlib. output_compression = On in the php. ini file;

4. Restart Apache:./apachectlrestart;

This article is from the "itdept" blog, please be sure to keep this source http://itdept.blog.51cto.com/1034307/1297135

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.