Skip to content
Advertisement

Check if PDFTOHTML is installed on server

I’m trying to check before running a php script if pdftohtml is installed on server.

Is there a way to check if pdftohtml is installed on server (linux or mac) from within the code.

I’m looking for something similar to function_exists()

Advertisement

Answer


Perhaps, the following will solve your case:

$isInstalled = (bool) shell_exec('which pdftohtml');

which returns nothing if the program isn’t found. But it will only work if it’s installed globally (without specifying an absolute path). And returns a full path if it’s there

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement