I wrote the following function in php
public static function convert($originFilePath, $outputDirPath, $toFormat)
{
$command = 'echo $PATH & UNO_PATH=/usr/lib/libreoffice unoconv --format %s --output %s %s';
$command = sprintf($command, $toFormat, $outputDirPath, $originFilePath);
exec($command, $output, $result_var);
return compact('output', 'result_var', 'outputDirPath', 'originFilePath', 'toFormat');
}
It did not generate any error message, or any pdf file as well.
In terminal, when I run the unoconv directly as www-data, I had no issues.
This is my result after execution:
2013-05-26 03:05:30 Error: Array
(
[output] => Array
(
[0] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
)
[result_var] => 1
[outputDirPath] => /var/virtual/storyzer.com/cake-json/ltequotationapp/webroot/outputfiles/Excel/2
[originFilePath] => /var/virtual/storyzer.com/cake-json/ltequotationapp/webroot/outputfiles/Excel/2/dsadas.xlsx
[toFormat] => pdf
)
Please advise.