Skip to content

Better error message when system and/or exec functions are disabled #168

@thiagoalessio

Description

@thiagoalessio

Expected behavior

Present a clear error message to users if environment has disabled system and/or exec builtin PHP functions, and interrupt the execution before attempting to use such disabled functions.

Actual behavior

Right now nothing stops the execution, and it fails much later with a "Command did not produce any output" exception.
Only warnings are shown:

<b>Warning</b>:  system() has been disabled for security reasons in ...
<b>Warning</b>:  exec() has been disabled for security reasons in ...

Steps to reproduce the behavior

  1. Disable system and/or exec in php.ini
    https://www.php.net/manual/en/ini.core.php#ini.disable-functions
  2. Try to run any TesseractOCR example.

Environment

  • Operating system: any
  • PHP version: any
  • Tesseract version: any
  • tesseract-ocr-for-php version: 2.7.4 or lower

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions