Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: The command did not produce any output. #173

Closed
ghost opened this issue Nov 26, 2019 · 3 comments
Closed

Fatal error: The command did not produce any output. #173

ghost opened this issue Nov 26, 2019 · 3 comments
Labels
invalid Not a real issue on the library

Comments

@ghost
Copy link

ghost commented Nov 26, 2019

Hello buddy. How can I solve this problem?

My Code:

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

require_once '../../../vendor/autoload.php';

use thiagoalessio\TesseractOCR\TesseractOCR;

$executable='/home/***/webapps/pub/thiagoalessio/tesseract_ocr';
$dir = $executable.'/temp_php';

if( chmod($dir, 0777) )
{
    
    echo (new TesseractOCR('text.png'))
        ->executable($executable)
        ->tempDir($dir)
        ->run();
    
         
    chmod($dir, 0755);
    
}
else
{
    echo "Couldn't do it.";
}

And the result:

Fatal error:
Uncaught thiagoalessio\TesseractOCR\UnsuccessfulCommandException: Error! The command did not produce any output.

Generated command:
"/home/***/webapps/pub/thiagoalessio/tesseract_ocr" "text.png" "/home/***/webapps/pub/thiagoalessio/tesseract_ocr/temp_php/ocro4YJIe"

Returned message:
sh: 1: /home/***/webapps/pub/thiagoalessio/tesseract_ocr: Permission denied in /home/***/webapps/pub/thiagoalessio/tesseract_ocr/src/FriendlyErrors.php:67

Stack trace:
#0 /home/***/webapps/pub/thiagoalessio/tesseract_ocr/src/TesseractOCR.php(32): thiagoalessio\TesseractOCR\FriendlyErrors::checkCommandExecution(Object(thiagoalessio\TesseractOCR\Command), '', 'sh: 1: /home/...')
#1 /home/***/webapps/pub/thiagoalessio/tesseract_ocr/test.php(20): thiagoalessio\TesseractOCR\TesseractOCR->run()
#2 {main} th in /home/***/webapps/pub/thiagoalessio/tesseract_ocr/src/FriendlyErrors.php on line 67
@thiagoalessio
Copy link
Owner

Hi @MabutasGroup , $executable='/home/***/webapps/pub/thiagoalessio/tesseract_ocr'; is not the executable you need ... what my library provides is only a convenient way of generating valid tesseract commands, but you still need the real tesseract installed on your server: https://github.com/tesseract-ocr/tesseract
and the real tesseract is what you should put in executable ;D

Since this is a usage question rather than a bug on the library, I'm going to close this and invite you to join https://gitter.im/thiagoalessio/tesseract-ocr-for-php in case you have further questions, sound good ?

@ghost
Copy link
Author

ghost commented Dec 1, 2019

Thank you for your responding.

tesseract-ocr/tesseract#751
It seems Blacklist and whitelist no longer work in 4.00alpha. They used to work in 3.04.
If I want to use them, I should downgrade to tesseract 3.04 ?

@akbarjondev
Copy link

akbarjondev commented Feb 18, 2020

Hi @thiagoalessio . Recently I have installed tesseract ocr php to my web hosting server. After some tests, I have had this error. Please help.

Fatal error: Uncaught thiagoalessio\TesseractOCR\UnsuccessfulCommandException: Error! The command did not produce any output. Generated command: "/home/g/gimmick/@@@.ru/public_html/bots/../tesseract/vendor/thiagoalessio/tesseract_ocr/src/TesseractOCR.php" "frame.jpg" "/tmp/ocrJvi4pJ" Returned message: sh: 1: /home/g/gimmick/@@@.ru/public_html/bots/../tesseract/vendor/thiagoalessio/tesseract_ocr/src/TesseractOCR.php: Permission denied in /home/g/gimmick/@@@.ru/public_html/tesseract/vendor/thiagoalessio/tesseract_ocr/src/FriendlyErrors.php:74 Stack trace: #0 /home/g/gimmick/@@@.ru/public_html/tesseract/vendor/thiagoalessio/tesseract_ocr/src/TesseractOCR.php(39): thiagoalessio\TesseractOCR\FriendlyErrors::checkCommandExecution(Object(thiagoalessio\TesseractOCR\Command), '', 'sh: 1: /home/g/...') #1 /home/g/gimmick/@@@.ru/public_html/bots/testejarimabot.php(409): thiagoalessio\TesseractOCR\TesseractOCR->run() #2 {main} thrown in /home/g/gimmick/@@@.ru/public_html/tesseract/vendor/thiagoalessio/tesseract_ocr/src/FriendlyErrors.php on line 74
err

@thiagoalessio thiagoalessio added invalid Not a real issue on the library and removed question labels Feb 18, 2020
Repository owner locked as off-topic and limited conversation to collaborators Feb 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid Not a real issue on the library
Projects
None yet
Development

No branches or pull requests

2 participants