Fatalerror: ClassZipArchivenotfound solution in php _ PHP Tutorial

Source: Internet
Author: User
Fatalerror: ClassZipArchivenotfound in php. When using the ZipArchive class, php prompts a Fatalerror: ClassZipArchivenotfound error. next we will introduce the solution in linux and windows. This error indicates that the program php prompts the Fatal error: Class ZipArchive not found error when using the ZipArchive Class. the solution in linux and windows is described below.

This error indicates that the program failed to call the 'ziparchive' class because php zip support (non-zlib) was not added during php installation ).

In Windows, the solution is:

1. in php. in the INI file, remove the semicolon ";" Before extension = php_zip.dll, and then in php. in the INI file, set zlib. change output_compression = Off to zlib. output_compression = On;

2. restart the Apache server.

Solution in Unix/Linux:

1. there is no php_zip.dll file in Linux (it does not work), so you need to recompile the php zip module. The installation method is as follows:

The code is as follows:

Cd/usr/src
Wget http://pecl.php.net/get/zip
Tar-zxvf zip
Cd zip-1.x.x
Phpize
./Configure
Make
Sudo make instal

The root permission may be required when you use the make install command. Therefore, we recommend that you use sudo to run the command. After installation, the location of zip. so is displayed. Record it, for example,/usr/local/lib/php/extensions/zip. so.

2. use root permission to modify php. ini (usually in the/usr/local/lib/folder, but depending on the initial installation of php, you can view it through phpinfo ):

Add

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

In the php. ini file

The code is as follows:
Zlib. output_compression = Off

Change

The code is as follows:
Zlib. output_compression = On;

3. do not forget to restart Apache: apachectl restart;

The zip module for php is installed, and the ZipArchive class can be used in php.

Warning error: Class ZipArchive not found error prompt. next we will introduce the solution in linux and windows. This error indicates a program...

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.