使用MAMP Pro从Mac上的php exec调用LibreOffice
好的,我有一个应用程序需要使用我的MAMP Pro安装和LibreOffice(4.4.1版)进行本地测试 当我在终端中执行以下命令时,它工作正常:使用MAMP Pro从Mac上的php exec调用LibreOffice,php,macos,pdf-generation,libreoffice,mamp-pro,Php,Macos,Pdf Generation,Libreoffice,Mamp Pro,好的,我有一个应用程序需要使用我的MAMP Pro安装和LibreOffice(4.4.1版)进行本地测试 当我在终端中执行以下命令时,它工作正常: cd /Applications/LibreOffice.app/Contents/MacOS ./soffice --headless --convert-to pdf /Users/myusername/Sites/my-site/_plugins/site-pages/public/build-pages/temp/*.docx --out
cd /Applications/LibreOffice.app/Contents/MacOS
./soffice --headless --convert-to pdf /Users/myusername/Sites/my-site/_plugins/site-pages/public/build-pages/temp/*.docx --outdir /Users/myusername/Sites/my-site/_plugins/site-pages/public/build-pages/temp
但当我尝试在php脚本中复制它时,如下所示:
$myCommand = '/Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to pdf /Users/myusername/Sites/my-site/_plugins/site-pages/public/build-pages/temp/*.docx --outdir /Users/myusername/Sites/my-site/_plugins/site-pages/public/build-pages/temp';
## create pdf's
exec($myCommand,$output);
foreach($output as $line){
print $line;
}
它不起作用,我做错了什么?你说的“不起作用”是什么意思?有错误吗?@JonasCz页面挂起,没有pdf文件是日志中的常见错误?我看不到任何错误,是否有我应该查看的特定日志?