Skip to content

Use exec() instead of system() for better compatibility with hosting providers #36

Description

@JoergCH

Feature Description

First of all, thank you for this super useful plugin :-)

While installing DocSearch on an Infomaniak shared hosting account (PHP 8.5, DokuWiki 2025-09-24), I encountered a compatibility issue ... and found a simple solution :-)

The plugin currently runs the configured converter using:

system($cmd, $exitCode);

On this hosting platform (Infomaniak, and I guess on many others):

  • CLI PHP (SSH) does provide system()
  • PHP-FPM (HTTP requests) does not provide system()
  • but exec() is available and provides exactly the functionality required by the plugin.

As a result, the plugin aborts with Error: Call to undefined function system()

Proposed solution

Simply replace the system() call with exec():

$cmdOutput = [];
exec($cmd, $cmdOutput, $exitCode);

($cmdOutput is used instead of $output to avoid colliding with the plugin's existing global variable.)

This works without any further changes. Since the plugin only checks the exit status and does not use the command output, exec() is a drop-in replacement.

After making this change, PDF indexing works correctly on Infomaniak shared hosting (been there, done that ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions