I am trying to perform an OCR using tesseract on a Windows based Apache server. It makes me mad. The following doesn't produce the expected E:\zzz.txt file:
<?php
$command = "\"C:\\ocr\\tesseract.exe\" \"E:\\www\\test\\upload\\proofs\\src\\yehia.raef.jpg\" \"E:\\zzz\" 2>&1";
print $command;
exec("$command", $msg);
print_r($msg);
?>
When I run the program, here is what I get:
C:\Users\blob\Desktop>php ici.php
"C:\ocr\tesseract.exe" "E:\www\test\upload\proofs\src\yehia.raef.jpg" "E:\zzz" 2>&1
Array
(
[0] => The filename, directory name, or volume label syntax is incorrect.
)
But now if run the command directly from the prompt:
C:\Users\blob\Desktop>"C:\ocr\tesseract.exe" "E:\www\test\upload\proofs\src\yehia.raef.jpg" "E:\zzz" 2>&
Tesseract Open Source OCR Engine v3.02 with Leptonica
It works like a charm. Please note this kind of command perfectly works with other software such as ImageMagick...
Help!