ZipArchive error on Linux!

Topics: Developer Forum
Jun 21, 2010 at 9:57 PM
Hi. I'm testing a PHPExcel under a Linux web server and I cannot fix a PHPZip error!. The code has been tested under Windows and it's working great!, same code NOT working at Linux, please help! already tried googleing the issue with no results, here are the details: Linux: Ubuntu Lucid Lynx PHP: 5.3.2.1-ubuntu4 Zip library: 1.9.1 Web server: Apache I'm just trying to open a Excel 2007 file and display it in a web browser. The error that throws is: Warning: ZipArchive::getFromName() [ziparchive.getfromname]: Invalid or unitialized Zip object in /var/www/wss/PHPExcel/Reader/Excel2007.php on line 269 Warning: ZipArchive::getFromName() [ziparchive.getfromname]: Invalid or unitialized Zip object in /var/www/wss/PHPExcel/Reader/Excel2007.php on line 272 Warning: Invalid argument supplied for foreach() in /var/www/wss/PHPExcel/Reader/Excel2007.php on line 310 Fatal error: Call to a member function getDrawingCollection() on a non-object in /var/www/wss/index.php on line 20 I'm sure it's not a problem in my code since it works at Windows. This is the code: <?php require_once 'PHPExcel/IOFactory.php'; $objPHPExcel = new PHPExcel(); $objReader = PHPExcel_IOFactory::createReader('Excel2007'); $objPHPExcel = $objReader->load("temp.xlsx"); $objWorksheet = $objPHPExcel->getActiveSheet(); foreach ($objWorksheet->getDrawingCollection() as $i=>$objImagen){ $filename = $objImagen->getPath(); $filename = substr($filename, strrpos($filename,"/")+1); @copy($objImagen->getPath(), 'images/' . $filename); $objImagen->setPath('images/' . $filename); } $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML'); $objWriter->setSheetIndex(0); echo $objWriter->generateHTMLHeader(); echo $objWriter->generateStyles(); echo $objWriter->generateSheetData(); echo $objWriter->generateHTMLFooter(); ?>