Can't edit www-data files; my user already in group

2

I installed a lamp server in my localhost for WordPress testing.

My files are stored in /home/user/webfiles, and I can create and upload files, but the files WordPress creates (E.G. .htaccess) are created with group permissions for www-data and these files can not be edited by my user account.

My user is in the group www-data

Is there a way I am able to fix this and be able to edit files that WordPress creates?

user447876

Posted 2015-05-13T20:14:03.017

Reputation:

Answers

1

Maybe the group you are using doesn't have rights to edit those files. Doing a ls -al will show the files and their modes. First group of rwx is for the user, second is for the group and third is for others. r is read, w is write and x is execute. Make sure that there is a w in the second group (it should appear in the middle of the file mode column, the 6th letter).

If you are missing rights for your group, use the file's owner user or root to set chmod g+w .htaccess (or whatever file you have issue with) and when you're done, for security reasons, you should remove w with chmod g-w .htaccess.

f.ardelian

Posted 2015-05-13T20:14:03.017

Reputation: 737

Ok, now read the rest of my answer... – f.ardelian – 2015-05-13T20:46:06.850

This is a Wordpress issue. I recommend you rewrite the question and tag it accordingly. Ask what you want to achieve by editing those files, because it should probably be done using Wordpress, so people will be able to tell you what to change in WP to get the effect you are looking for. – f.ardelian – 2015-05-15T00:29:27.347