I have a php script in a directory called /manager. In it, I open and write to a file in the directory above /manager. However, if the permissions are set to allow owner write, I get "failed to open stream: Permission denied"
It only works when I change permissions to allow public write, but doesn't this allow anyone to write to my file? Could this be happening because it is reaching up a directory, or am I misunderstanding permissions?
My first question is who owns the directory? is it Apache? If not, then you will probably have issue writing to that directory. Your next option is to allow group permissions to handle things -- is the owner in the www group? (Pardon if that is not the right name) If so, you can have the group permissions set to allow Apache and yourself to write (assuming that the owner is in the group).
As to public write -- that means that all users and services which are running on/logged in to that machine will be able to write to that directory. It does not mean that a malicious person operating outside of the machine will be able to futz with it... unless he happens to be able to sign on...