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