Search code examples
phpcommand-line-argumentswindows-server-2008-r2pdftk

php exec command not running?


I have a PHP file Executing a shell command for a tool called PDFTK.

The command works fine when I run it directly from the command line but through the PHP script it self, it does not and doesn't throw an error.

The command i am running is:

$WshShell = new COM("WScript.Shell");
$WshShell->Exec("pdftk Template.pdf fill_form 1406822788.fdf output test2.pdf");

This takes the .fdf data and puts it into the template pdf and then creates the outout of test2.pdf.

Again, works fine when ran directly through the command line.

Any ideas on what I can try to get this to run?


Solution

  • Check the return of the method Exec, or try:

    exec("pdftk Template.pdf fill_form 1406822788.fdf output test2.pdf");