I am making use of PDFTK to watermark PDF files using the following command:
pdftk /tmp/55180af7c8c88.pdf stamp /tmp/stamp55180af7c95b84.58412952.pdf output /tmp/55180af7c95c81.06110501.pdf
However the above results in:
Error: Failed to open output file:
/tmp/55180af7c95c81.06110501.pdf
No output created.
Error: unable to open file for output: /tmp/55180af7c95c81.06110501.pdf
The above is a strange error because PDFTK should be creating that output file!
If I put sudo
infront of the command, no error is thrown. But I am writing to the tmp folder and this is writeable by all I thought?
I am running PDFTK from PHP's exec
command. To be 100% sure that this isn't a permissions issue, I made the /tmp
folder owner and group to be www-data
, which is the apache user but the same error is thrown.
I now have no idea what is going on, I appreciate any help!
ls -ld /tmp /tmp/55180af7c95c81.06110501.pdf