PHP fatal Error:class ziparchive not found workaround _php Tutorial

Source: Internet
Author: User
Tags ziparchive
PHP fatal Error:class ziparchive not found error prompt when using the Ziparchive class, let's describe the workaround in Linux and Windows.

This error indicates that the program did not succeed when calling the ' Ziparchive ' class because it did not add PHP zip support (not zlib) when installing PHP.

The solution under Windows is:

1, in the php.ini file, will extension=php_zip.dll the front semicolon ";" Remove, and then also in the php.ini file, change zlib.output_compression = Off to zlib.output_compression = on;

2. Restart the Apache server.

Solutions under Unix/linux:

1, there is no php_zip.dll this file under Linux (and will not work), so you need to recompile the PHP zip module. The specific installation method is as follows:

The code is as follows Copy Code

Cd/usr/src
wget Http://pecl.php.net/get/zip
TAR-ZXVF zip
CD zip-1.x.x
Phpize
./configure
Make
sudo make instal

In the final use of the Make install command, you may need to use root permissions, so it is recommended to use sudo to run. After installation, you will be prompted for the zip.so location on the screen. It is then recorded, such as:/usr/local/lib/php/extensions/zip.so.

2, the use of root permissions to modify php.ini (usually may be in the/usr/local/lib/folder, but depending on the original installation of PHP, can be viewed through phpinfo ()):

Increase

The code is as follows Copy Code
Extension =/usr/local/lib/php/extensions/zip.so

, and then also in the php.ini file,

The code is as follows Copy Code
Zlib.output_compression = Off

Switch

The code is as follows Copy Code
Zlib.output_compression = on;

3, finally do not forget to restart the apache:apachectl restart;

This zip module for PHP is installed and can be used in PHP with the Ziparchive class.

http://www.bkjia.com/PHPjc/632190.html www.bkjia.com true http://www.bkjia.com/PHPjc/632190.html techarticle PHP fatal Error:class ziparchive not found error prompt when using the Ziparchive class, let's describe the workaround in Linux and Windows. This error message appears to be a program ...

  • Related Article

    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.