ZipArchive is a built-in compression and decompression function in php. if newZipArchive is used to create a zip file today, the following error occurs: Fatalerror: ClassZipArchive... zipArchive is a built-in compression and decompression function of php. if we use new ZipArchive to create a zip file today, the following error occurs: Fatal error: Class ZipArchive not found in, the following php entry network partner to look at the troubleshooting methods for this problem.
The test code is as follows:
// PHP decompress the file (zip) function unzip_file ($ file, $ destination) {$ zip = new ZipArchive (); // open the compressed file if ($ zip-> open ($ file )! = TRUE) {die ('could not open Archive');} // create a file $ zip-> extractings ($ destination); $ zip-> close (); echo 'successfully ';}
When executing the command, we found that: Fatal error: Class 'ziparchive 'not found in E: wwwqqdown. php on line 63 is not undefined. Therefore, we can search Baidu for it as follows.
In Windows, the solution is:
1. in the php. ini file, remove the semicolon ";" Before extension = php_zip.dll.
Restart the Apache server. we can try again.
For a linux system, refer to the following method.
There is no php_zip.dll file in Linux. you need to re-compile the php zip module. the installation method 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 run the command using sudo. after the installation, the screen will prompt zip. and then 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 php installation, you can view it through phpinfo ).
Add extension =/usr/local/lib/php/extensions/zip. so, and change zlib. output_compression = Off to zlib. output_compression = On in the php. ini file;
3. do not forget to restart Apache: apachectl restart;
Note:Some friends on the website said zlib. change output_compression = Off to zlib. output_compression = On; I have not operated On php in windows. ini file is not seen, but it can indeed generate or decompress the file.
Address:
Reprinted at will, but please attach the article address :-)