Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用MAMP Pro从Mac上的php exec调用LibreOffice_Php_Macos_Pdf Generation_Libreoffice_Mamp Pro - Fatal编程技术网

使用MAMP Pro从Mac上的php exec调用LibreOffice

使用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

好的,我有一个应用程序需要使用我的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 --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文件是日志中的常见错误?我看不到任何错误,是否有我应该查看的特定日志?