Open LeiraT opened 3 years ago
I believe it is because the command fail to execute.
Try go to public function convertTo($filename)
in OfficeConverter.php
and locate $shell = $this->exec($this->makeCommand($outdir, $outputExtension));
You can try to debug that command output in your terminal.
I got same issue. that execute command is libreoffice --headless --convert-to pdf inputpath outputdir
from this package. if I'm trying to execute command in system /Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to pdf inputpath outputdir
in terminal. it's working fine.
Can you guide us on where we need to add exe path in laravel project?
The issue is cause by the constructor default bin value:
public function __construct($filename, $tempPath = null, $bin = 'libreoffice', $prefixExecWithExportHome = true)
Try change it to the path where libreoffice located in your system:
$bin = '/Applications/LibreOffice.app/Contents/MacOS/soffice';
$converter = new OfficeConverter('test-file.docx', 'path-to-outdir', $bin);
I got same issue. that execute command is
libreoffice --headless --convert-to pdf inputpath outputdir
from this package. if I'm trying to execute command in system/Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to pdf inputpath outputdir
in terminal. it's working fine.Can you guide us on where we need to add exe path in laravel project?
In Ubuntu 22.04 I solved it by giving permission to the /var/www directory for the user www-data sudo chown -R www-data:www-data /var/www/
In Ubuntu 22.04 I solved it by giving permission to the /var/www directory for the user www-data sudo chown -R www-data:www-data /var/www/
in Ubuntu 20 , It worked for me too, thanks @gtcesar
Hello, Im using laravel 8. I already install libre office 7.0.5 in centos 7. I also already update public function __construct($filename, $tempPath = null, $bin = ' ', $prefixExecWithExportHome = true) { if ($this->open($filename)) { $this->setup($tempPath, $bin, $prefixExecWithExportHome); } }
and protected function makeCommand($outputDirectory, $outputExtension) { $oriFile = escapeshellarg($this->file); $outputDirectory = escapeshellarg($outputDirectory);
but it still return the Convertion failure. Contact Admin