I recently ran into this same problem when I switched web hosting companies. All of a sudden I couldn't write to certain files anymore that I had always written to! I was not happy, to say the least :-<
What I found is (according to my new web host) that if you upload a file (via FTP) to a folder on the server, you cannot write to it. The Apache Server owns this file. But if you allow your script to create the file on the server, then everything is Ok. This gets into security issues and the exact way the PHP module is installed by your web host (which arcane details I have since forgotten). You have to work closely with your web hosting co. on this one. They must set file permissions for you, since you are not the superuser. They are.
This limitation is very disappointing to most people who are used to having complete ownership over "their" files, but the Internet has really muddied this concept of ownership.
p.s. I never had this problem of "ownership" with Verizon, my former web host. But saving $40 a mo. was worth it to me.