Search code examples
phppdfcommand-linepdftk

PDFTK Location (500 Internal Error)


So I have PDFTK installed, and seems to work when inside the root directory. (IE: /public_html/) But as soon as I move my script into a 'folder' (IE: /public_html/test/) it forms a 500 Internal Server Error.

This is the code I have, and have tested.

// Option 1
$command = 'pdftk test/FormTest.pdf fill_form test/FormTestData.fdf output output.pdf flatten';

// Option 2
$command = '/usr/bin/pdftk test/FormTest.pdf fill_form test/FormTestData.fdf output output.pdf flatten';

// Option 3
$command = '/usr/local/bin/pdftk test/FormTest.pdf fill_form test/FormTestData.fdf output output.pdf flatten';

$response = passthru($command);

echo "<pre>";
print_r($response);
echo "</pre>";

These options all seem to return the same ERROR (500). The weird part is when I run it within the root of the site, it works fine.

Any help would be appreciated.


Solution

  • There was an issue where I had installed PDFTK. All is working now.