Cannot call antiword from PHP using exec()
Posted: Wed Feb 16, 2005 6:19 pm
Hi!
I've set up a site part of which allows ppl to upload docs which I then try to parse to get any plain text out of them - PDF and Word DOC formats.
I have two apps to do this - pdftotext and antiword - and I'm calling them with the PHP command exec()
Both apps are in the same folder, they both read from the same folder, and try to write to a new file in the same folder. Both have the same permissions. PDFTOTEXT works fine, ANTIDOC doesn't.
The only real diff I can see is that PDFTOTEXT allows you to specify an output file, whereas ANTIDOC dumps to the screen by default, so has to be directed (antidoc source.doc > source.txt) to get it to write out to a file.
When called directly from the command line antiword works fine - so the app seems ok.
Does anyone have any idea what might be causing this to fail when called from PHP? I have to have this working next week so am a little desperate for help here!
I'm using a managed server, so I don't have root access.
Cheers!
I've set up a site part of which allows ppl to upload docs which I then try to parse to get any plain text out of them - PDF and Word DOC formats.
I have two apps to do this - pdftotext and antiword - and I'm calling them with the PHP command exec()
Both apps are in the same folder, they both read from the same folder, and try to write to a new file in the same folder. Both have the same permissions. PDFTOTEXT works fine, ANTIDOC doesn't.
The only real diff I can see is that PDFTOTEXT allows you to specify an output file, whereas ANTIDOC dumps to the screen by default, so has to be directed (antidoc source.doc > source.txt) to get it to write out to a file.
When called directly from the command line antiword works fine - so the app seems ok.
Does anyone have any idea what might be causing this to fail when called from PHP? I have to have this working next week so am a little desperate for help here!
I'm using a managed server, so I don't have root access.
Cheers!