soffice command not execute in php shell_exec()

2k views Asked by At

I have run this command in shell_exe() function as shown below:

shell_exec('/usr/bin/soffice --headless --convert-to html:HTML --outdir /home/admin/Desktop/ /home/admin/Desktop/text.docx');

But it gives me error like this in apache error log:

Error: Please reverify input parameters...

1

There are 1 answers

7
ino On

The error you have received is not PHP / apache related.

It is an soffice output.

So shell_exec() works without problems even the executed command returned an output that was passed back to the shell_exec() function.

How to run soffice I recommend search forums like: https://ask.libreoffice.org/en/question/2641/convert-to-command-line-parameter/

To receive the error output is better to use exec() function instead of shell_exec()

getting output and exit status from shell_exec()

https://unix.stackexchange.com/questions/15264/executing-a-shell-command-from-php-with-shell-exec