Forum


Replies: 2   Views: 3336
Pro version generating corrupt docx
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by shroom  · 10-12-2015 - 18:51

I have been developing with the trial version of phpdocx and it was working fine.  We purchased a PRO license and installed phpdocx on the live server.  Every docx generated MSWord thinks is corrupt.  I'm getting the "We're sorry.  We can't open <filename> because there is a problem with its contents."  When I click the "Details" button, it says "The file is corrupt and cannot be opened."  But when I click "OK", MSWord finds the content and offers to open it.  When I open it, the document is fully intact, with no problems at all.

What could be causing this?

Thanks.

Let me add then when I run /check.php, everything is fine.

Posted by shroom  · 10-12-2015 - 20:32

The problem has something to do with the live server (located at Hostmonster).

I copied the trial phpdocx installation to the live server and the problem still exists.  What works perfect on the dev server does not work on the live server, even though all the files are identical.

Here is the results of /check.php from the DEV server:

PHP_VERSION: 5.5.23
PHP_OS: WINNT
PHP_UNAME: Windows NT BRAIN2 6.2 build 9200 (Windows Server 2012 Standard Edition) AMD64
SERVER_NAME: xxxxxxxxxxxxxx
SERVER_SOFTWARE: Apache/2.4.12 (Win64) OpenSSL/1.0.1m PHP/5.5.23
SERVER_ADDR: xxx.xxx.xxx.xxx
SERVER_PROTOCOL: HTTP/1.1
HTTP_HOST: xxxxx.xxx
HTTP_X_FORWARDED_FOR: 
PHP_SELF: /phpdocx/check.php
ZipArchive: 1
DomDocument: 1
SimpleXMLElement: 1
Tidy: 1

 

Here is the results of /check.php from the LIVE server:

PHP_VERSION: 5.4.43
PHP_OS: Linux
PHP_UNAME: Linux host168.hostmonster.com 3.12.49-35.ELK6.x86_64 #1 SMP Fri Oct 9 18:26:47 CDT 2015 x86_64
SERVER_NAME: xxxxx.xxx
SERVER_SOFTWARE: Apache
SERVER_ADDR: xxx.xxx.xxx.xxx
SERVER_PROTOCOL: HTTP/1.1
HTTP_HOST: xxxxx.xxx
HTTP_X_FORWARDED_FOR: 
PHP_SELF: /phpdocx/check.php
ZipArchive: 1
DomDocument: 1
SimpleXMLElement: 1
Tidy: 1

Do you have any ideas what I need to check/change?

Thanks.

Posted by shroom  · 10-12-2015 - 21:08

I figured it out.  createDocxAndDownload() does not work on the live server.  I changed the way the doc is downloaded and all is well.

Thanks for reading..  :)