Search code examples
phpocrtesseract

Error! The command "tesseract" was not found. (PHP thiagoalessio)


I am encountering this error message

Error! The command "tesseract" was not found.

However, tesseract and tesseract php wrapper is already installed.

When I run below,

echo (new TesseractOCR())->version();

it shows the version. When I run this,

$ocr = new TesseractOCR(asset('uploads/img.jpg'));
$ocr->run();

the error shows.

Please help.

Thank you!

my Code

public function creditCardOrderProcessImage() 
{
    $image = Input::file('image');
    $name = time().'-'.$image->getClientOriginalName();
    $file = $image->move('uploads/', $name);

    echo '<img src ='.asset('uploads/'.$name).' />';

    $ocr = new TesseractOCR(asset('uploads/'.$name));
    $ocr->run();

}

Solution

  • Youre just trying to define the image path? See

     $ocr = new TesseractOCR();
     $ocr->image('uploads/img.jpg');
     $ocr->run();