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