简体   繁体   English

OpenOffice转换器不适用于Apache

[英]OpenOffice converter don't work with apache

Does anyone know why this works great with phpCLI but fails with apache? 有谁知道为什么这对phpCLI很好用,但对Apache却失败了?

$cmd = "soffice --headless --nofirststartwizard -convert-to pdf:writer_pdf_Export file.doc -outdir converted/";
exec($cmd, $dump, $ret);

I was struggling with this few more hours, but finally I've found solution here http://geekswithblogs.net/robertphyatt/archive/2011/11/19/converting-.docx-to-pdf-or-.doc-to-pdf-or-.doc.aspx 我在这几个小时中苦苦挣扎,但终于在这里找到了解决方案http://geekswithblogs.net/robertphyatt/archive/2011/11/19/converting-.docx-to-pdf-or-.doc-to -pdf-or-.doc.aspx

I hope this can help someone else 我希望这可以帮助别人

Try use "export HOME=/tmp" before run OpenOffice. 在运行OpenOffice之前,请尝试使用“导出HOME = / tmp”。

Example: 例:

  export HOME=/tmp
  soffice --headless --convert-to pdf --outdir /var/www/public/uploads/ /var/www/public/uploads/artcl.ppt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM