Error with PHP ZipArchive

Topics: User Forum
Oct 5, 2008 at 5:23 PM
Edited Oct 5, 2008 at 5:31 PM

I recently moved a program that uses PHPExcel from a local WAMP (windows apache mysql php) development  environment to a LAMP (linux apache mysql php) testing server which created an error.  Whenever I open an excel file created on the LAMP testing server it says: “Excel found unreadable content in [filename].xlsx.  Do you want to recover the contents of this workbook?  If you trust the source of this workbook, click Yes.”  Clicking yes recovers the contents and everything seems to work fine.  But I need to get rid of the error message.

I’ve done a good bit of searching on the subject and the closest reference I can find is this thread here:  The solution to their issue was updating PHP to 5.2.5.  However, our LAMP testing server is running PHP 5.2.6, and I don’t see any reference in the PHP changelog that indicates a change in ZipArchive between 5.2.5 and 5.2.6, which was identified as the cause of the error in the above thread.

Does anyone have any ideas on how to fix this?  Please let me know if more info about the server or any other configuration setting would be useful.



Oct 5, 2008 at 5:32 PM
Edited Oct 5, 2008 at 5:34 PM
Some questions:
  1. Is this happening for any Excel file that you create?
  2. What component are you using: Excel5 writer or Excel2007 writer?
  3. Can you upload the broken file somewhere so we can inspect?
EDIT: Sorry, Q2 is already answered: Excel2007 writer.
Oct 6, 2008 at 4:42 AM
Thanks for the quick response.  I should have checked back sooner.

1) Yes it is happening with all excel files.
2) Correct, I'm using Excel2007.
3) I'll have to create an excel file without sensitive info and then post it.

Thanks for your help.