美文网首页
php system调用libreoffice转换文件 retu

php system调用libreoffice转换文件 retu

作者: muti_wu | 来源:发表于2017-11-01 10:54 被阅读0次

    操作系统:centos6.7 64位

    执行命令:system("libreoffice --invisible --convert-to pdf --outdir /phpstudy/www/Uploads/activity/2017-02-28/ /phpstudy/www/Uploads/activity/2017-02-28/58b53f9cad22e.xls",$retcode);

    输出$retcode = 77

    修改命令为:system("libreoffice --invisible --convert-to pdf --outdir /phpstudy/www/Uploads/activity/2017-02-28/ /phpstudy/www/Uploads/activity/2017-02-28/58b53f9cad22e.xls 2>&1");

    输出信息:[Java framework] Error in function createSettingsDocument (elements.cxx). javaldx failed! Warning: failed to read path from javaldx Warning: failed to read path from javaldx

    修改代码为:system("export HOME=/tmp/ && libreoffice --invisible --convert-to pdf --outdir /phpstudy/www/Uploads/activity/2017-02-28/ /phpstudy/www/Uploads/activity/2017-02-28/58b53f9cad22e.xls 2>&1");

    返回信息:convert /phpstudy/www/Uploads/activity/2017-02-28/58b53f9cad22e.xls -> /phpstudy/www/Uploads/activity/2017-02-28//58b53f9cad22e.pdf using calc_pdf_Export convert /phpstudy/www/Uploads/activity/2017-02-28/58b53f9cad22e.xls -> /phpstudy/www/Uploads/activity/2017-02-28//58b53f9cad22e.pdf using calc_pdf_Export

    执行成功。

    参考文献:https://stackoverflow.com/questions/22973641/php-libreoffice-shell-exec-not-working

    相关文章

      网友评论

          本文标题:php system调用libreoffice转换文件 retu

          本文链接:https://www.haomeiwen.com/subject/nipwpxtx.html