-2

HI I am using Docker with symfony project inside that It checks for libreoffice. I am getting the below eeror and response code is 500.

"libreoffice is not executable at /usr/bin/libreoffice"

if (!is_executable($this->libreOffice)) {
            $logger->critical(sprintf('[ReportTemplateService][error] libreoffice is not executable at %s', $this->libreOffice));
            throw new \Exception(sprintf('libreoffice is not executable at %s', $this->libreOffice));
        }
        $this->twigEngine = $twigEngine;
        $this->logger = $logger; 

Can anyone help me out here.

1 Answers1

0

is_executable Returns true if the filename exists and is executable, or false on error.

Make sure the container is properly configured to access the file

So start checking whether /usr/bin/libreoffice exists, file permissions, and whether it is executable. So get into the container shell, then run the following command:

ls -la /usr/bin/libreoffice
GabrieleMartini
  • 1,665
  • 2
  • 19
  • 26
  • How I can check this if this is accessible from inside the container? – Chandrakant Aug 23 '21 at 04:56
  • I already went there but I thought I am doing it wrong. So the output is ls: cannot access '/usr/bin/libreoffice': No such file or directory. Now the question is How can it be accessible ? Without going inside docker I am getting this ls -la /usr/bin/libreoffice lrwxrwxrwx 1 root root 34 Mar 15 23:42 /usr/bin/libreoffice -> ../lib/libreoffice/program/soffice – Chandrakant Aug 23 '21 at 08:27
  • Not sure if this will help but /usr/bin/libreoffice is the folder but to execute a spreadsheet, for example you need to use /usr/bin/libreoffice -calc %f (see https://help.libreoffice.org/latest/he/text/shared/guide/start_parameters.html) – Michael Moriarty Apr 25 '23 at 16:40