Newbie Help - Help getting simple example working

Topics: Developer Forum, Project Management Forum, User Forum
Jun 15, 2009 at 5:58 PM

Hi there,

I've uploaded the entire package of files up onto my linux server (paid monthly shared hosting account) and I'm testing the first basic example (01simple.xlsx)

On running the related script I get the following error:

18:28:33 Create new PHPExcel object
18:28:33 Set properties 18:28:33 Add some data 18:28:33 Rename sheet 18:28:33 Write to Excel2007 format
Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file /home/testing123/public_html/1.6.7/Tests/01simple.xlsx.' in /home/testing123/public_html/1.6.7/Classes/PHPExcel/Writer/Excel2007.php:398 Stack trace: #0 /home/testing123/public_html/1.6.7/Tests/01simple.php(75): PHPExcel_Writer_Excel2007->save('/home/testing123/...') #1 {main} thrown in /home/testing123/public_html/1.6.7/Classes/PHPExcel/Writer/Excel2007.php on line 398

Now I see the FAQ mentions about a zip file library error message, but this is not the same error message I'm getting (although the word zip is mentioned).

Also if I remove the following line from the code in the example

$objWriter->save(str_replace('.php', '.xlsx', __FILE__));

I do not get an error message (but of course the file is not created)

 

Sorry if I'm doing something stupid here but I'm a bit stumped at the moment. And sorry if tagging all areas was not right. Just needed help from whoever can.

Thank in advance for any input.

 

 

 

Jun 15, 2009 at 6:49 PM

Does PHP has write permissions in the folder you are writing it to?

Jun 15, 2009 at 9:54 PM

Dope! When I made the folder write permissions the create of the Excel file on the server worked and the script did not reprot any errors. Thanks.

Now got to work out how I pop it up so the user can download it, but sure that's in the docs or just geenral PHP somewhere. This library looks excellent and I really hope it works solidly for the project I'm doing (which needs to generate a lot of Excel spreadsheets).

 

Thanks