centos系统下,用php的system命令unoconv把word转pdf时提示Unable to connect or start own listene的解决办法
unoconv -o /foo/bar/public_html/upload/ -f pdf /foo/bar/public_html/upload/test.docx 2>&1
上面这个命令在shell 终端能执行成功,但是在php(Apache)中会报错:Unable to connect or start own listene
只需要先设置HOME变量即可:
passthru('export HOME=/foo/bar/public_html/upload/ && unoconv -o /foo/bar/public_html/upload/ -f pdf /foo/bar/public_html/upload/test.docx 2>&1')
https://yidianhulian.com/?p=12281https://yidianhulian.com/?p=12281