I have private server CentOS 6 and I have installed pdftk
program to generate pdf files. When I connect with SSH client, I can run pdftk program successfully. But I couldn't in php
with exec()
function.
I have a very simple php file as shown below. This is only to test if pdftk is working or not. When I ran this file on my localhost with xampp, it generates the file but when I tried on my private server, not gives error and not generates the file. I am not expert and expecting any help from you. Thanks in advance.
PHP CODE:
<?php
exec("pdftk form.pdf output private.pdf");
The error look like this:
Array ( [0] => Error: Failed to open output file:
[1] => collated.pdf [2] => No output created.)
Note: I have tried this code on putty ssh client and works perfectly.