Answer the question
In order to leave comments, you need to log in
How to properly set file permissions?
It seems like such an elementary thing, but I can’t understand if I’m doing it right - the text for the sitemap is generated on the server and then this text is written to it, but with the rights somehow I think it’s not what I need, I set the rights 666 is written, I set 664 " failed to open stream: Permission denied", but if you set 666, then as I understand it, anyone can change it, right? And why at 664 writes that there are not enough rights, because
"user" - the owner of the file
"group" - one of the members of the group to which the owner belongs
"world" - "the rest of the world", that is, all other users
Answer the question
In order to leave comments, you need to log in
You have a file created from one user, and php is executed from another, which is not even included in the group of the first.
Try to create a php file next to the sitemap, compare the owners and make sure.
The problem is solved simply - you need to change the owner of the file to the user under which php is running.
sudo chmod 666 /directory/folder/file... (you can also 777, well, with all rights)
if on a folder, then:
sudo chmod -R 777 /directory/folder
directories 755
files 644
without special need, these rules should not be changed,
but for paranoids, you can tighten
them PS
only the owner of the file can change it
when the file is written by the server, then it has a different name and group (open and see the owner
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question