1

I try to exec the following command with php:

shell_exec('libreoffice --headless --convert-to pdf test.doc 2>&1');

and I get the following error:

[Java framework] Error in function createSettingsDocument (elements.cxx).
javaldx failed!
Warning: failed to read path from javaldx

This works:

exec('touch test1');

And on command line this also works (pdf is generated):

$ libreoffice --headless --convert-to pdf doc1.doc

is that a permission problem? How can I solve it?

mickmackusa
  • 43,625
  • 12
  • 83
  • 136
Asara
  • 2,791
  • 3
  • 26
  • 55

1 Answers1

0

Try to set an output path like:

exec('libreoffice --headless --convert-to pdf test.doc --outdir /YOUR/PATH/');

or you try something like this for your webserver user:

sudo -u www-data -c "export HOME=/tmp"

found here: https://stackoverflow.com/a/10193459/5431346

Community
  • 1
  • 1
wdj-pascal
  • 31
  • 1
  • 10