我已经在shell_exe()函数中运行了这个命令,如下所示:
shell_exec('/usr/bin/soffice --headless --convert-to html:HTML --outdir /home/admin/Desktop/ /home/admin/Desktop/text.docx');但是,在apache错误日志中,它给了我这样的错误:
错误:请重复输入参数..。
发布于 2017-12-13 06:28:05
您收到的错误与PHP / apache无关。
这是一个soffice输出。
因此,shell_exec()工作没有问题,甚至执行的命令也返回一个输出,该输出被传回给shell_exec()函数。
如何运行soffice我推荐搜索论坛,如:https://ask.libreoffice.org/en/question/2641/convert-to-command-line-parameter/
要接收错误输出,最好使用exec()函数而不是shell_exec()函数。
https://unix.stackexchange.com/questions/15264/executing-a-shell-command-from-php-with-shell-exec
https://stackoverflow.com/questions/47786675
复制相似问题