相关疑难解决方法(0)

unoconv使用www-data从终端工作,但不从php脚本也作为www-data工作

我在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');
}
Run Code Online (Sandbox Code Playgroud)

它没有生成任何错误消息,也没有生成任何pdf文件.

在终端中,当我直接将unoconv作为www-data运行时,我没有任何问题.

这是我执行后的结果:

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
)
Run Code Online (Sandbox Code Playgroud)

请指教.

php pdf shell ubuntu uno

6
推荐指数
2
解决办法
3722
查看次数

标签 统计

pdf ×1

php ×1

shell ×1

ubuntu ×1

uno ×1