0

I have installed TesseractOCR from terminal of mac. when i run the following command from terminal it is working.

tesseract "hello.png" /Applications/MAMP/tmp/php/987051047

but the same command is not working in

exec("tesseract "hello.png" /Applications/MAMP/tmp/php/987051047")

and the full code is

$tesseract = new TesseractOCR("hello.png");

$tmp_dir = ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir();

$tesseract->setTempDir( $tmp_dir );

$test =  $tesseract->recognize();

I feel I have to load tesseract in php.ini or any other configuration file. but I don't know where. I am using mac, MAMP, php 5.4.10

1 Answer 1

1

Ok after installation we need to change the path for bin

$path = getenv('PATH'); putenv("PATH=$path:/usr/local/bin");

add these lines and it will work

Thanks

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.