The ZipArchive configuration in Linux throws the ZipArchivelibraryisnotenabled exception when uploading an Excel file under Linux today. While the code on my local windows server runs normally. The reason is: In Linux, there is no php_zip.dll File (either...
The ZipArchive configuration in Linux throws the "ZipArchive library is not enabled" exception when uploading an Excel file under Linux today. While the code on my local windows server runs normally. The reason is: In Linux, there is no php_zip.dll file (or it will not work), so you need to re-compile the php zip module. Solution in Unix/Linux: www.2cto.com 1. run the following command in sequence: cd/usr/src wget http://pecl.php.net/get/zip (The latest version is downloaded online by default) tar zxvf zip-1.x.x.tgz (package name downloaded) cd zip-1.x.x/usr/bin/phpize (corresponding phpize path find/-name phpize results/usr/bin/phpize ). /configure -- with-php-config =/usr/bin/php-config (corresponding php-config path) make instal 2. view the generated module path (after installation, zip will be displayed on the screen. so location): cd/usr/lib/php/modules/(corresponding extensions path/usr/lib/php/modules/) 3. modify php. extension = zip added to ini. so and then in php. in the INI file, set zlib. change output_compression = Off to zlib. Output_compression = On; 4. restart Apache:./apachectl restart; www.2cto.com. the zip module for php is installed. you can use the ZipArchive class in php. Note: the solution in Windows is relatively simple: 1. in php. in the INI file, remove the semicolon ";" Before extension = php_zip.dll and. in the INI file, set zlib. change output_compression = Off to zlib. output_compression = On; 2. restart the Apache server.
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