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...