I am trying to convert files from doc to pdf on my aws linux server. On my previous machine, it worked fine, but now I have problems with my new machine. The only difference is that I upgraded from PHP 7.0 to PHP 7.2. and version for office libre
LibreOffice 6.0.1.1 00m0 (Build: 1)
I tried to give root permissions to libreoffice and a package that executes the command but does not succeed.
This is the package I'm using https://github.com/szonov/libreoffice-converter
I use it with laravel 5.4. This is the code in the package that performs the action.
$replacement = array( 'bin' => $this->bin, 'convert_to' => $convert_to, 'outdir' => $outdir, 'source' => $this->source ); $cmd = $this->makeCommand($replacement); $cmd = "sudo ".$cmd; shell_exec($cmd); $result = false; if (file_exists($outfile)) { $this->mkdir(dirname($this->destination)); $result = rename($outfile, $this->destination); }
I tried adding sudo since when it runs the dd and sudo command it works on the command line.
Syed Abdur Rehman Kazmi
source share