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.

*************************
Did you know?Explore Trending and Topic pages for more stories like this.
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

Really need helps regarding Pagination with Sort
I need someone helps regarding pagination problem...i actually want to make my page limited to let s

Not showing whole name with mail () script
I sent up a simple mail form with the PHP mail() script. One problem is when it sends an email with

how to remove in php string display
My code is

$message="We're looking at developing our website.";

$body= "

Retrieving Data from Two Different Databases
Hello All,

Ran into another problem and would appreciate some help! I have two datab

IP Based Cron Jobs
I run cronjobs on my website. After one of my visitors got curious and tinkered around he realized h

How do I create a 2D game "camera" to follow player?
In J2ME programming I'm targeting MIDP 2.0 devices.

I'm using gamecanvas and I was thinking t

PHP not creating file.
Its supposed to create a .ini file in the /scriptfiles/users/ with the name they entered into the fi

To change the name of label on SAP screen XK02.
Hi All,

Can one suggest me how to change the label of an input field of a sap standard s

Need Help with a query
Hello,
For some reason I am just not getting the right answer when I do this query and not quite

help with this code please?
Hello,

I am trying to build a remote upload script for my image hosting site.

I am usi

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