I broke Wordpress file and map ownership

Posted December 9, 2014 3.4k views

Hi all, I hope it is possible to help me with the following case.

Because of the github developer pack I started trying to run some websites and see what I can learn in this field. However I think I broke something which I don’t know how to fix.

I run the one-click-wordpress install. So all is relatively standard. I did set up SSH access with another account so that root is not used.

Now the website itself seems to work, however on the backend I can no longer install updates (core and plugins) or upload files even. They return a similar error that either they cannot create a map or cannot move a file (image for example).

Now I read that ownership permissions for files should be set correctly, according to wordpress they should be 644 for files and 755 for folders. Which is what I set them all at.

But still it seems to not work, so I guess the owner of the folders and files is the wrong one. But I don’t know how to set those or to set those to the right user?

I would really like help on that one to solve the updating through the buildin update mechanics of wordpress (and of course uploading).

Thanks in advance!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

For CentOS/RHEL-like servers:

chown apache:apache /var/www/ -R

For Debian/Ubuntu:

chown www-data:www-data /var/www/ -R
  • Thanks,

    I ran this command. Using ubuntu, I still receive the errors that the file cannot be moved and the folders cannot be created (for plugin update)

  • I don’t usually offer this, but I’m willing to provide hands-on assistance in this case. I don’t work for DO, and am in no way affiliated with DO aside for being a customer who is also an addict on helping others. As long as you agree not to hold myself liable, I’ll gladly log on to your sever, find the issue, then fix it at no cost.

    Just shoot me an e-mail

    jon is my name is the domain

    It’s name at domain.

  • Dear Jon,

    your first comment actually did fix it! I rebooted my droplet after which I ran the command again with sudo in front of it. After that I ran automatic updates on the wordpress backend without any problems and uploaded a media file without any problems.

    Sorry for confusion, and thanks a lot for the offer to fix it for me as well! Marked your comment correct.

    It is great how friendly and helpful DO as well as the community of DO is!