简体   繁体   English

"unoconv 命令作为 apache 运行时出错"

[英]Error when unoconv command is run as apache

Below is the error I am getting when unoconv<\/code> command is run as apache, with root it works fine.以下是我在unoconv<\/code>命令作为 apache 运行时遇到的错误,使用 root 可以正常工作。

[root@tux1 apache]# sudo -u apache unoconv -f pdf /var/www/html/testing/example.xlsx

Ok this may be a stupid way to get around it but here goes...好的,这可能是绕过它的一种愚蠢的方法,但是这里...

Something in the chain of tools wants a home directory.工具链中的某些东西需要一个主目录。 The user for Apache doesn't have a home directory. Apache 的用户没有主目录。

My Apache2 runs as www-data .我的 Apache2 作为www-data运行。

So:所以:

mkdir /home/www-data
chown www-data:www-data /home/www-data

Voila!瞧! No more errors.没有更多的错误。

If I were a real geek I would fix the problem further up the tool chain but I'm not so there.如果我是一个真正的极客,我会在工具链上进一步解决问题,但我不是这样。

I had this error when converting .docx or .doc to HTML using unconv via PHP on Apache:在 Apache 上通过 PHP 使用 unconv 将 .docx 或 .doc 转换为 HTML 时出现此错误:

Error: Unable to connect or start own listener. Aborting.

Eventually, I worked out the issue was with the www-data user not being able tom write to its home folder (in my case at /var/www ).最终,我发现问题是 www-data 用户无法写入其主文件夹(在我的情况下是/var/www )。 I fixed the permissions and the error was sorted.我修复了权限并对错误进行了排序。

我添加了具有 www-data 用户权限的 .config 和 .cache 子文件夹,并将根目录保留在 /var/www/ https://stackoverflow.com/a/70891861/8187662

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

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