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 will be downloaded online by default) tar zxvf zip-1.x.x.tgz (downloaded package name) cd zip-1.x.x/usr/bin/phpize (corresponding phpize path find/-name phpize out result/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/modul Es/) 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 is installed on the php zip module and 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.