how do I fix permission errors on a new digital ocean 1 click install?

April 13, 2016 449 views
WordPress Ansible Ubuntu

Hello to all. I successfully installed wordpress using the tutorial located at

Worked like a dream, except I can't import my xml file full of posts. I successfully migrated the wp-content directory from one server to another last night but when I went to import the xml file,I got he error that it was unable to write to wp-content/uploads/2016/04

I know it's a permissions issue but trying

Sudo chown apache:apache uploads/
failed with unknown user apache:apache.

It now turns out that I'm having issues updating the plugins due to similar permission errors. I think the two might be related. Here is an example of one of the errors when updating.

I don't have visudo set up right now so am just doing everything as root. I know I know, not safe, but doing this at 11:45 at night I wanted to get as much done before I crashed for the night. By the way I'm not exactly a beginner with ubuntu, but I'm not at intermediate either. I do know kind of what I'm doing as I dabble in Unix and Jessie.


1 comment
  • Thanks. I think it worked, but don't close the thread just in case. Lol! Wish I were a more advanced user so I could figure out all of this stuff by myself, but I love learning anyway. Will keep an eye on this. Here's hoping I have the ram and stuff set up right and stuff so that all updates can be completed etc.

2 Answers

It sounds like you've got the problem figured out and updating the ownership of the files should resolve it. On Ubuntu, the default user apache runs as is "httpd" so running:

chown -Rf www-data:www-data uploads/

should resolve the problem.

Sadly that didn't work. I'm still getting the same error I posted before. I won't repeat it here for brevity's sake. I did not get an error when performing the chown command though. So at least that's progress. I'm also still getting the error of

Sorry, there has been an error. The uploaded file could not be moved to wp-content/uploads/2016/04.

Restarting apache2 did not work either. I'm stuck here as I've been googling around since about 11:45 last night trying to solve this problem.

  • A couple more suggestions.

    1.) Try setting your whole wordpress installation as owned by www-data using the same chmod command but set at the web root directory.

    2.) Try setting the permissions on the upload directory to 755

    chmod -Rf 777 uploads/
Have another answer? Share your knowledge.