Can anyone tell me why it doesn't work on the hosting provider and how I can fix this issue. I am under the impression that it is a security issue.
My guess is you simply don't have write permission in the required directory.
You create your temporary file in the current working directory (.
). Depending on your hosting provider and the HTTP server configuration, the current working directory is not necessary what you think nor writable. Especially since your program will probably run with the www or nobody identity.
I assume you have to create and then adjust the permissions on your "temporary" directory -- or use a "world writable" location such as /tmp
.
Finally, you have a relative path that move "upward" in your program: ./../../reports/TEST.pdf fill_form
There is little chances for this to be valid on your hosting...