php/ ziparchive

I used ZipArchive class to zip file before downloading.

On execution it gives following error:

Uncaught PHP Exception Symfony\\Component\\Debug\\Exception\\FatalErrorException: \\"Compile Error: require_once(): Failed opening required 'PHPEXCEL_ROOTPHPExcel/Shared/PCLZip/pclzip.lib.php' (include_path='/vendor/phing/phing/classes:/vendor/pdepend/pdepend/src/main/php:/vendor/phpmd/phpmd/src/main/php:.:/usr/share/pear:/usr/share/php')\\" at /vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/ZipArchive.php line 6"

php -m has both zip and zlib

Can anyone please help? Not sure why it is pointing to PHPExcel path as well.

Tried installing phpoffice/phpexcel using composer but it didn't help

    $path = __DIR__.'abc.log';
        $zip = new ZipArchive();
        $zippath = __DIR__.'abc.zip';
        if ($zip->open($zippath, ZipArchive::OVERWRITE) === TRUE)
        {
            // Add file to the zip file
            $zip->addFile($path);
        }

Expecting it to zip the file at a location

You are getting this error because PHP-ZIP extension is not installed in your server.
Follow below steps

I hope it will resolve your issue.

暂无
暂无

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question Piwigo "Abort pclzip.lib.php : Missing zlib extensions" error PHP - pclzip.lib troubles Corrupt ZIP files using PHP & PCLZip Creating zip files with PCLZIP.LIB: invalid variable type error PHP - PCLZIP adding file from string PHP Pclzip library: To rename files before being compressed Swedish characters (ÅÄÖ) gets messed up in PclZip zip files pclzip to backup two directories Wordpress theme upload error PCLZIP_ERR_BAD_FORMAT Using CURL with PclZip Class
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM