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

pagination - need help on passing of search query.
Hi, i have been trying for days but couldn't get this sorted out. Would like some professional help

Call Screen statement Error
Dear Experts,

is there any setting that needs to be done before creating any dialog progr

Comparing MySql data and arrays.
I have a mysql table set up like this:
idsubjectbodyuseriddatetimetags1blog subjectblog body111|2

Problem with DB connection
Hello there! I'm new to this forum and I'm new to PHP coding also. I wrote something that doesn't ma

Working with Dates, help.
Sooo to make a long story short, here's what im trying to accomplish.

I need to create a drop

undefined offset help
Hi All,

I kept getting undefined offset PHP notice for a simple for loop. For eg
$va = arr

Adding post count
How would I make it so everytime someone clicks submit on my form, their row in the database for the

textfield unchanged
hi,
i want my form to know whether its textbox is unchange or not.

if($textbox == 'unchang

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

can i optmize image to 50% quality before uploading 2 server
Hi there

i have jus written a php program to upload and display images but when i try to uplo

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