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

Warning: Cannot modify header information - headers already sent by (output sta
Warning: Cannot modify header information - headers already sent by (output started at /home/praylif

extract data
Code: <div class="post hentry uncustomized-post-template">

Searching keywords from array
Hello everyone, Im just wondering if someone could help me with another issue im having. Im still le

Number Format
Hi All,

I have number '000000000050085' I want to format it to 500.85 Can any one give me

Writing Windows Device Drivers with C
Yes: one of the nice features of C is void*. You can put anything there and get anything out. Very

Problems with adding a link to one position in a 'foreach' loop, please help
Hello!

Iam pretty new to programming and I wanna create a table with users from an array. It

foreach result into a single variable
Hi,

I have this code...

Code: [Select]foreach ($_POST['Interests'] as $interest =&

b+ tree
Hi
can every body help me about b+ tree ?(insert & delete)

Deleting a record php
Attempting to setup delete a record page. The below code I put together doesn't seem to work.

Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing,

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