PHP ziparchive is a PHP extension class, you can easily achieve the zip file compression and decompression, the use of the class before you need to ensure that the PHP ZIP extension is open, if you do not open the class to use directly, the program will report the Fatal error class ' Ziparchive ' not found ... This error, the following article on this error sharing the solution.
The first thing we need to know is that this error indicates that the program did not succeed when it called the ' ziparchive ' class because it did not add PHP zip support (not zlib) when installing PHP.
Then the process steps are as follows:
(1) Check if the Ext folder in the PHP installation folder has php_zip.dll this file
(2) To ensure that the above documents exist under the premise, modify the php.ini file, remove Extension=php_zip.dll front ";", open ziparchive Extension
(3) Restart Apache to
The following separately describes the Windows system and Linux system respectively
Specific steps
Windows system
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 Apache Server
Unix/linux system
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:
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 extension =/usr/local/lib/php/ Extensions/zip.so, and then also in the php.ini file, change zlib.output_compression = Off to zlib.output_compression = on;
3. Don't forget to restart Apache at the end:
Apachectl Restart;
This zip module for PHP is installed on the completion of the above processing, your server should be able to directly run ziparchive this class.
The above solutions if there are doubts and errors, welcome message correction.