I need to use PDFTK. It works when I use it in terminal as root, but when I try to use it with www-data I'm consistently getting a permission error.
When switching to www-data:
sudo -u www-data shand executing:
fpdtk simply.pdf generate_fdf output fields.fdfI get this output:
Error: Unable to find file.
Error: Failed to open PDF file:
simply.pdf
Errors encountered. No output created.
Done. Input errors, so no output created.It seems the issue is that permission is denied for www-data user.
How can I change this?
22 Answers
This article saved my life! I has the same error using the pdftk snap.
Simply create a symlink with this command:
sudo ln -s /snap/pdftk/current/usr/bin/pdftk /usr/bin/pdftk The issue was that the current folder was not owned by www-data. So be sure that the the owner is the same as the apache user(www-data or daemon)
2