I am using tesseract-ocr-for-php. I have installed it on my AWS EC2 Ubuntu machine without any error. I create file with name test.php to test the functionality. Below is the code
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
include 'TesseractOCR.php';
//$obj = new TesseractOCR('var/www/html/ocr-tesseract/src/text.png');
//var_dump($obj->run());
var_dump (new TesseractOCR('var/www/html/ocr-tesseract/src/text.png'))->run();
//echo dirname(__FILE__);
die('dafs');
and the output is
object(TesseractOCR)#1 (8) { ["image":"TesseractOCR":private]=> string(39) "var/www/html/ocr-tesseract/src/text.png" ["executable":"TesseractOCR":private]=> string(9) "tesseract" ["tessdataDir":"TesseractOCR":private]=> NULL ["userWords":"TesseractOCR":private]=> NULL ["userPatterns":"TesseractOCR":private]=> NULL ["languages":"TesseractOCR":private]=> array(0) { } ["psm":"TesseractOCR":private]=> NULL ["configs":"TesseractOCR":private]=> array(0) { } } Fatal error: Call to a member function run() on null in /var/www/html/ocr-tesseract/src/test.php on line 13
What is wrong I am doing?
i tried with this link too. but still same.