Can't write Excel2007, Excel5 works fine

Topics: User Forum
May 12, 2009 at 6:15 PM

Hi,

I'm using the library on a Linux Redhat server.

writing a .xls works fine but no file is created when invoking:

$nombreArchivo='Cartera.xlsx';
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save($nombreArchivo); 

where $nombreCompleto is a string something like 'John Smith'

however this code does work on another server.

Which configuration parameters might I be missing.

I've set these ones.

----

set_time_limit(300);
ini_set('max_execution_time', 1000);
ini_set('memory_limit', '100M');

----

 

Developer
May 12, 2009 at 6:20 PM

Try to put this at the beginning of your script and see if you get any error messages.

error_reporting(E_ALL);
ini_set('display_errors', '1');

Perhaps the zip extension is missing?

 

May 12, 2009 at 7:22 PM

Thanks for the prompt response

That's it!!

Fatal error Class 'ZipArchive' not found in /var/www/html/PHPExcel/Classes/PHPExcel/Writer/Excel2007.php

how can I get this class?

Thanks again.

Regards

DG.-

 

 

Developer
May 13, 2009 at 12:34 AM

Make sure that your PHP installation satisfies requirements from here:

http://phpexcel.codeplex.com/Wiki/View.aspx?title=Requirements