Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3802250
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:10:44+00:00 2026-05-19T14:10:44+00:00

I am looking to convert a large number of image files into text using

  • 0

I am looking to convert a large number of image files into text using Tesseract.

I have looked at their documentation but have not idea how that relates to PHP and how my php script will interact with tesseract ocr. I have seen on other questions that suggest that php exec() might be the way.

$img = myimage.png;
$text = exec($img,'tesseract');

I have downloaded and installed tesseract.
Using windows 7 with a recent version of xampp installed.
I have a beginner to intermediate knowledge of php.
What knowledge am I missing?

Update I now have it working with in powershell and cmd with

tesseract.exe D:\Documents\Web_Development\Sandbox\php\images\23.png D:\Documents\Web_Development\Sandbox\php\images\23

But When I try to run it through exec like this:

<?php 
exec('tesseract.exe D:\Documents\Web_Development\Sandbox\images\23.png D:\Documents\Web_Development\Sandbox\images\23');
?>

I get a popup from windows that says the tesseract.exe has stopped working. here are the error details if they mean anything to anyone.

Problem signature:
  Problem Event Name:   BEX
  Application Name: tesseract.exe
  Application Version:  0.0.0.0
  Application Timestamp:    4ca507b3
  Fault Module Name:    MSVCR90.dll
  Fault Module Version: 9.0.30729.4926
  Fault Module Timestamp:   4a1743c1
  Exception Offset: 0002f93e
  Exception Code:   c0000417
  Exception Data:   00000000
  OS Version:   6.1.7600.2.0.0.768.3
  Locale ID:    1033
  Additional Information 1: e958
  Additional Information 2: e95831f9d00a16a326250da660e931c5
  Additional Information 3: 040a
  Additional Information 4: 040a259d27c5ccf749ee18722d5fbec0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T14:10:45+00:00Added an answer on May 19, 2026 at 2:10 pm

    You should try to get it working without PHP, that is, to run it from the ms windows CLI interface (the ms-dos prompt). After that, you simply put whatever you have typed in the CLI in the PHP runtime, running it via CLI or some other IPC mechanisms, eventually parameterizing it with PHP variables.

    For example, if in the CLI you would be typing

    ipconfig /all
    

    to get the IP configuration of the system, then in PHP you’d simply use:

    <?php
    echo '<pre>';
    echo exec('ipconfig /all');
    echo '</pre>';
    

    Back to your problem, if in the CLI you’d be issuing:

    tesseract document.tif result
    

    Then in PHP you’d do

    <?php
    echo '<pre>';
    echo exec('tesseract document.tif result');
    echo '</pre>';
    

    That’s about it. It’s not specific to tesseract, it works with any program (with a CLI interface).

    If you need more control over the output, or the input (as it’s the case when the user is asked for input while the program is running), you should use the proc_*() family of functions from http://ch2.php.net/manual/en/function.exec.php

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a mac and looking to batch convert a large amount of eps
I'm looking for a solution to convert a set of files using the terminal
I am looking for a way to convert a base-10 number into a base-N
I am looking for an efficient way to convert a large int[] into a
I have a rather large CVS repository that I am looking to only convert
I have a large set of classic ASP pages to convert. I will be
I need to break apart a large collection of wav files into smaller segments,
I'm looking to convert a file to a binary string, preferably using PHP. Is
I have a string name called name that I am looking to convert to
Looking for a c# class or similar that can parse or convert wiki-formated text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.