Most Likely, the file you are trying to write to, does not Exsist or is not CHMOD'ed to the Right permissions for the Script? (the files its writing to should be CHMOD'ed to 777), otherwise the Script would not able to Write / touch it..
Im only learning PHP, xD, so I dont know, but Give it a...