Problem executing bash script using shell_exec


Posted on 16th Feb 2014 07:03 pm 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.

No comments posted yet

Your Answer:

Login to answer
142 Like 9 Dislike
Previous forums Next forums
Other forums

Preg_match question
I want to use preg_match to make sure a string is always 6 characters long and only contains 0-9 and

Last character removed
I have created a string from an array. I have inserted commas from my form values. I am trying to re

Multithreading in Oracle (Java, SQLJ, Pro*C,??) on 10g
I am investigating how to run a Java stored procedure in multithread mode.
I know that if I chang

Javascript using window.location seems to lose state
Not sure what forum so let me know if I'm in the wrong place. I have a main window with a ajax grid

Hom to make one url to open together with another url
I have a chat, which i want to be opened, as soon as the users login to the site. As it is now, when

help understanding hidden input w/ php
hello i'm doing a tutorial where there are multiple forms for an edit page for a user to update thei

strtotime issue
Hey all,

I'm playing around with some code, and basically the idea is:

Person changes

How to make a mail Form secure?
I want to create an email Form on my web site. How can I make the Form secure so the submitted info

Embedding flash object in Else statement
This is my first major project in PHP and I'm having some trouble embedding a flash object in an Els

How To Make More Than One Redirection with PHP on the same page?
Hey im trying to do a direction page where it open differently link direction pages every time som

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash