【问题标题】:Tesseract CLI in PHP not working, but SSH doesPHP 中的 Tesseract CLI 不起作用,但 SSH 可以
【发布时间】:2013-08-14 04:24:22
【问题描述】:

我有 tesseract 与 SSH 一起使用,但是当我在 PHP 中使用它时它不起作用。我的 PHP 配置为能够执行 CL。

exec('tesseract /fullpath/to/document.png /fullpath/to/output');

我将 CL 与 IM/GS 等一起使用,效果很好。我不明白为什么这会因为 tesseract 的命令而失败。有什么想法吗?

【问题讨论】:

  • 可能是权限问题。尝试使用 2>&1 将 stderr 重定向到 stdout 以获取更多信息。

标签: php command-line-interface tesseract


【解决方案1】:

这是一个权限问题。我使用了http://phpseclib.sourceforge.net/,这对我来说是最快和最简单的方法。总共花了 30 秒。

include('sshlib/SSH2.php');
$ssh = new Net_SSH2('www.example.com');
if (!$ssh->login('user', 'pass')) {
    exit('Login Failed');
}
echo $ssh->exec('boom command works 2>&1');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-23
    • 1970-01-01
    • 1970-01-01
    • 2012-10-24
    • 2018-01-11
    • 1970-01-01
    • 1970-01-01
    • 2022-12-16
    相关资源
    最近更新 更多