Running libreoffice from php exec()

前端 未结 7 1318
臣服心动
臣服心动 2020-12-16 16:05

I have installed libreoffice headless on a freebsd-server with apache in order to convert documents programmatically (e.g. odt->pdf). It works from the command line! But my

7条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 16:23

    I'll recomend put config path first you run exec() or shell_exec();

    IE:

    // Vars
    putenv('PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin');
    putenv('HOME=' . $outputdir); 
    

    $outputdir = chmod 777 And the same forlder from libreoffice command "--outdir"

提交回复
热议问题