1

When I check the file permission on a newly, locally installed Wordpress site (i.e. downloaded from wordpress.org/download) the owner is ll782 (my username) and the group-owner is admin. Wordpress doesn't seem to belong to either of these.

I'm looking at the permissions for the .htaccess file which I want Wordpress to be able to write to.

e.g. -rw-r--r--@ ll782 admin .htaccess

If I change the permissions to 774 and Wordpress still can't write to this file. I have to change the group to '_www' before Wordpress can update the file. Should I be setting the owner to _www or is there a better way?

Secondly, if I SFTP the file to the server, will it retain the same owner and group? Will it retain the same permissions?

I'm trying to understand what _www is and why Wordpress belongs to this user/group on my local server.

2 Answers 2

1

I think the real question you have here is — what user/group WordPress belongs to?

WordPress itself essentially doesn't have a user/group. From perspective of filesystem it is just a bunch of PHP source files lying around.

What is really "has" a user here is your web server and/or PHP binary. Together they execute WordPress source files and any file operations are under their authority.

In a nutshell — owner and permissions of files that you want editable need to be configured appropriately for your specific server, which varies depending on the server. Obviously permissions need to be as narrow as possible (777 and such isn't wise that is).

1
  • thanks for the clarity. I'll update the question title a I was struggling with the semantics. Commented Apr 10, 2016 at 21:08
0

Ok, so in answer to the second part of the question.

if I SFTP the file to the server, will it retain the same owner and group? Will it retain the same permissions?

I just tried it out – uploaded a file via SFTP then SSH'ed onto the server to see if the owner or permissions match the file I uploaded. They don't, so it seems safe to set local permission and owners as required locally and not worry about this compromising security on the remote server.

Re. the first part of the question, I'm curious why Wordpress is _www on my localhost but perhaps that has more to do with MAMP (which I user for my local server) than Wordpress. If anyone has any info on this it would be appreciated. Cheers!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.