php - php 正方体错误!找不到命令“tesseract”
问题描述
我正在尝试并未能使用 tesseract php。我收到此错误:
Fatal error: Uncaught thiagoalessio\TesseractOCR\TesseractNotFoundException: Error! The command "tesseract" was not found. Make sure you have Tesseract OCR installed on your system: https://github.com/tesseract-ocr/tesseract
The current $PATH is C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\xampp\php;C:\ProgramData\ComposerSetup\bin;C:\Users\Peppe\AppData\Local\Microsoft\WindowsApps;C:\Users\Peppe\AppData\Roaming\Composer\vendor\bin in C:\Users\Peppe\vendor\thiagoalessio\tesseract_ocr\src\FriendlyErrors.php:48 Stack trace: #0
C:\Users\Peppe\vendor\thiagoalessio\tesseract_ocr\src\TesseractOCR.php(26): thiagoalessio\TesseractOCR\FriendlyErrors::checkTesseractPresence('tesseract') #1 C:\xampp\htdocs\index.php(7): thiagoalessio\TesseractOCR\TesseractOCR->run() #2 {main} thrown in C:\Users\Peppe\vendor\thiagoalessio\tesseract_ocr\src\FriendlyErrors.php on line 48
我正在使用在 C:\xampp 中安装了 xampp 的 Windows 10。php 版本 7.4 我从https://github.com/UB-Mannheim/tesseract/wiki安装了 x32 和 x64 的 tesseract.exe 我使用 composer 安装了https://github.com/thiagoalessio/tesseract-ocr-for- php,它没有给出任何错误。
<?php
require_once 'C:\Users\Peppe\vendor\autoload.php';
use thiagoalessio\TesseractOCR\TesseractOCR;
$ocr = new TesseractOCR("caption.jpg");
$content = $ocr->run();
echo $content;
?>
最后,caption.jpg 位于 htdocs 文件夹、主文件夹和与 index.php 相同的文件夹中,其中出现了上述代码。
任何解决方案?
解决方案
推荐阅读
- mongodb - Mongodb 聚合 $group 并计算日期范围
- dart - 在 setState 对象上没有调用构造函数,它从前一个对象收集数据
- json - 无法批量索引到弹性搜索
- kubernetes - 在 istio 网格内的 pod 的所有出站 HTTP 调用上获取 404
- c++ - 在 MDI 子窗口中添加 QML 文件
- android - 当召回方法片段未附加到上下文错误时。我应该发送和接收什么上下文?
- angular - 无法在 Angular 中获取当前的纬度和经度
- ios - 在 iOS swift 中设计导航栏
- python - 使用 Python 3 将文件 POST 到 AWS Mediastore,无需开发工具包,无需 CLI
- ruby-on-rails - 搜索后如何在rails中保持复选框的真实值