I
I
Iossarian2020-04-29 16:32:36
PHP
Iossarian, 2020-04-29 16:32:36

Why doesn't libreoffice convert the file via shell_exec?

Good afternoon. It is required to convert a docx file on the server to pdf and send it for download. I put the file in the folder, then I do the following:

chdir(__DIR__ . '/../../docs/payment_directory/' . $id . '/');
shell_exec('libreoffice  --headless  --convert-to pdf word.docx');

The getcwd () wardump shows that I am in the correct directory. shell_exec returns null even though everything works from the console.
Tell me what could be the problem? Thank you.

UPD: the --backtrace flag returned:
warning: Currently logging to gdbtrace.log. Turn the logging off and on to make the new setting effective.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fdec0ffc700 (LWP 13666)]
[New Thread 0x7fdebfda9700 (LWP 13667)]
[New Thread 0x7fdebf5a8700 (LWP 13668)]
[Thread 0x7fdebfda9700 (LWP 13667)
exited]
[Thread 0x7fded97526c0 (LWP 13661) exited]
[Inferior 1 (process 13661) exited with code 0115]
/usr/lib/libreoffice/program/gdbtrace:9: Error in sourced command file:
No stack.
(gdb) quit

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question