tesseract - Teserract not working on PHP version 7.2.31
Get the solution ↓↓↓When I run tesseract via terminal it works but when I try from php I get an error
here is the code
<?php
require_once('./vendor/autoload.php');//<-This!
use thiagoalessio\TesseractOCR\TesseractOCR;
$content = new TesseractOCR('kod.jpg');
$text = $content->run();
echo $text;
?>
here is the error
Notice: tempnam(): file created in the system's temporary directory in /Applications/XAMPP/xamppfiles/htdocs/job/vendor/thiagoalessio/tesseract_ocr/src/Command.php on line 47
Warning: unlink(/var/folders/h8/qn5xtrwd667f0nk2bvdtzg8m0000gn/T/): Operation not permitted in /Applications/XAMPP/xamppfiles/htdocs/job/vendor/thiagoalessio/tesseract_ocr/src/TesseractOCR.php on line 174
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 /usr/bin:/bin:/usr/sbin:/sbin in /Applications/XAMPP/xamppfiles/htdocs/job/vendor/thiagoalessio/tesseract_ocr/src/FriendlyErrors.php:40 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/job/vendor/thiagoalessio/tesseract_ocr/src/TesseractOCR.php(26): thiagoalessio\TesseractOCR\FriendlyErrors::checkTesseractPresence('tesseract') #1 /Applications/XAMPP/xamppfiles/htdocs/job/index.php(7): thiagoalessio\TesseractOCR\TesseractOCR->run() #2 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/job/vendor/thiagoalessio/tesseract_ocr/src/FriendlyErrors.php on line 40
Thank you.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: constant expression contains invalid operations
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.