Generating docx using PHPword gives Import Error on Mac

Joined
May 16, 2013
Messages
4
Reaction score
0
Points
1
Hi All,

I am using PHPword library and creating a doc file from a website. It is running perfectly on Windows and Linux machines but am getting "Import Error" on Mac machine when I try to open it using iWork. When I email that file and try opening on a Mac machine, it does not work.
I even tried generating the doc file from the Mac machine directly using the same process (PHPword library), I get the same "Import Errror" on Mac.

Can somebody help me out on this? Its a very crucial issue that I am facing.
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
Apparently, the docx file created by PHP is not compatible with iWork Pages. I'm assuming you don't have MS Office for the Mac? And why would you want to use PHP to create a docx file on your Mac when iWork Pages can do it? I guess I should ask why you're even using PHP when there are so many free programs for Windows and Linux which can create Office files easily? Also for the Mac.
 
OP
J
Joined
May 16, 2013
Messages
4
Reaction score
0
Points
1
I am using a web application in which I've a lot of memories. I am using PHPword to export those memories into a doc file for my future reference.
Please help me out on this as my client is getting angry.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
You're going to have to elaborate on your setup here. Why are you using a web application here? Is the content stored online in a database or something similar?

It sounds like you're trying to run this off of a web server running on your Mac. OS X uses Apache just as most Linux installs do so it isn't erroring out because of compatibility issues. Have you configured your web server properly?
 
OP
J
Joined
May 16, 2013
Messages
4
Reaction score
0
Points
1
yes the server is configured properly as I've already mentioned that I am able to export my memories into .docx format and they are open-able in windows and Linux machines but not in Mac machine. The content is stored online into a DB.
The doc file that is exported via PHPword, contains text and images and I can open the file in Windows and Linux machines but when I export the same file and try to open it into Mac machine, it gives me "import error" and the file is not getting opened at all.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Have you tried using something other than iWork to see if it's the file or the application? LibreOffice is free and might help with this test.
 
OP
J
Joined
May 16, 2013
Messages
4
Reaction score
0
Points
1
I've never tried Libreoffice on Mac. My client loves using iWork and his friends too. So, he's insisting me to resove the problem for iWork.
I respect your suggestion, but I am bounded to resolve this issue for iWork.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I wasn't suggesting you switch. I simply meant that you try opening the document in LibreOffice to see whether or not the document is in fact corrupted.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top