I noticed that in order for me to be able to write output to external file, I must have that file CHMOD 0777.
Now, this file will have static html in it to be used as include. Question, how bad of a security risk is it to leave static HTML page with 0777 permissions. There is no direct link to that file otherwise.
I tried to see if I can CHMOD the file to 0777 using PHP, write my output and then CHMOD it back to 0644, but it doesn't seem to work. I suppose my server settings do not permit it.