Hi, sorry for bumping this old thread - but it was the youngest of the handful of old, unresolved threads I found on this subject 🙂
I have exactly the same problem - using PHP to handle a file upload, and if it's a Word doc I need to run it through antiword to get the text out.
Run from the command line antiword either dumps the plain text out to the screen, or it can be piped (>) to another file. So it seems that antiword does work?
However, running the very same shell command via PHP's exec command produces the output file, but like others have said, it is empty (0 bytes).
I'm relieved to see that people who have properly compiled and installed antiword on their systems have the same problem, because I just copied an executable onto mine - I don't have rights to compile and install new apps. I had thought that was likely to the the problem.
So does anyone have any ideas? Did anyone solve their problem with antiword?
I've also tried putting the antiword command in a shell script and calling that instead - again it works from the command line, but fails from PHP.
Also note - on my set up I'm also handling PDFs with the app pdftotext. I have that exe in the same directory as antiword - same permissions etc, reads and writes to same dir - and that works when called with exec()!!!
The only real diff between how the two work is that pdftotext allows you to specify a destination file, whereas with antiword you have to pipe the output.
Could the > be to blame here?
I really need to get this working by next week - so would really appreciate any help!