Php Echo exec不工作tesseract

Php Echo exec不工作tesseract,php,exec,echo,tesseract,Php,Exec,Echo,Tesseract,我正在将tesseract与PHP结合使用,这是我第一次使用exec /usr/local/bin/tesseract/images/hello.png stdout可以通过SSH完美地工作,但是当我尝试通过PHP运行它时,什么都没有发生 echo exec('/usr/local/bin/tesseract images/hello.png result'); 但如果我尝试 echo exec('/usr/local/bin/tesseract images/hello.png result

我正在将tesseract与PHP结合使用,这是我第一次使用
exec

/usr/local/bin/tesseract/images/hello.png stdout
可以通过SSH完美地工作,但是当我尝试通过PHP运行它时,什么都没有发生

echo exec('/usr/local/bin/tesseract images/hello.png result');
但如果我尝试

echo exec('/usr/local/bin/tesseract images/hello.png result 2>&1');
然后,页面将使用Leptonica编写
Tesseract开源OCR引擎v3.03,因此我觉得必须关闭


有什么想法吗?

通过以下方法实现了

exec('/usr/local/bin/tesseract /images/hello.png stdout', $msg);
print_r($msg);

返回值

命令结果的最后一行。如果您需要执行命令并将命令中的所有数据直接传回而不受任何干扰,请使用passthru()函数

要获取已执行命令的输出,请确保设置并使用输出参数