I have a server that runs a small application that we use to create .docx.
It worked fine on the old server, but I had to move it to another, and now it has a big problem: when I run the php script - based on PHPWord - the output files are broken and cannot be used (MS Word Messages "File xyz.docx cannot be opened because there are problems with the content).
Also, you cannot change the file extension from .docx to .zip (just look at its contents).
The “funny” side of this problem is that on the same server, using the same version of PHP, it disappears with nginx 1.2.3, and the .docx file is perfect (well, if you don't care about the content ... but this is another problem ...).
I can enable nginx, but I have another problem: I cannot read Latin1 special characters as expected.
After a long search and search in the code, I found that the problem is related to the following line contained in the Template.php library PHPWord, lin 105: $ this → _ objZip-> addFromString ('word / document.xml', $ this → _ documentXML);
It seems to work fine (and it really works fine on nginx), but it creates a fake .docx that cannot be opened.
I tried different versions of the Apache server with no luck, so I would really appreciate any help.
In summary:
- I tested my script (which uses PHPWord) on a Windows Server 2003 host and php 5.2.8
- It works fine with nginx
- It creates a bad .docx file with apache (ZipArchive addFromString does not work)
- Apache, 2.0.64 2.2.25
?