I am using Python. The folder permission is 'rwx r-x r-x' all the way down to the file from httpdocs (I changed it recursively). However, the file stayed at 'rw- r-- r--' no matter how I changed it. Also, when I try to write a non-existent file
open("nonexist.ext", "w")
It also result with an permission error.
Anyway, when I tried to write a file from php, it worked. I thought about using FTP and binding php with python but it consumes more memory and cpu, which I don't want it to.