Problem executing bash script using shell_exec

Posted on 16th Feb 2014 by admin

Hi there,
I created a bash script file using following code to convert doc documents to pdf using OpenOffice macros.

*************************
doc2pdf:
#!/bin/sh

echo "hi"
DIR=$(pwd)
/usr/bin/oowriter "macro:///Standard.Word2PDF.DOC2PDF($1,$2)"
echo "bye"
***************************

when i execute doc2pdf /blah/blah.doc /blah/blah.pdf command from gnome-terminal it works fine.

But when i use following php script it just echo "hi" and "bye" but it doesn't execute the middle line.
***************************
<?php
print_r(shell_exec("doc2pdf args blah blah"));
?>
***************************
Please help me to find a solution.

Other forums