WordPress Multisite is unable to upload media files because it does not have the necessary permissions.

Posted June 24, 2013 12.1k views
WordPress 3.5 changes where media files are uploaded from blogs.dir to wp-content/uploads/sites/{site_id}. I have configured Multisite to use subdomains and the only way I have been able to allow WordPress to upload files (images) is to manually create the necessary folder structure and then to give 777 permissions. $ chmod 777 /var/www/wp-content/uploads/sites/2 $ chmod 777 /var/www/wp-content/uploads/sites/3 etc. This seems as though PHP does not have permissions to create/write files on my droplet. I'd obviously prefer my permissions to be 755. Any thoughts?

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
4 answers
you need to chown your installation to the php user too. i.e. if your user is www-data and they're a member of www-data you'd do
$chown -R www-data:www-data /var/www/wp-content/uploads/sites/
Try adding the user that owns /var/www/wp-content/uploads to the www-data group and chmod uploads to 775:

usermod -a -G www-data youruser
chmod 775 /var/www/wp-content/uploads
I'm still very new to this and ran across this same problem. I set up LAMP on my Ubuntu 12.10 server using the tutorial, virtual hosting with Apache2 again using the tutorial and then installed Wordpess, pointing it towards the Apache2 virtual host that I had setup. I ran into this same bug, and tried to use what you all suggested without any success.

Initially, it told me I didn't have the permissions to do that, so I tried to log in again into my root account (which I didn't disable) and it did not give me the error message, but also did not fix my problem. I tried restarting the servers, but the problem has persisted.

Anything else I can try? or any particular Apache2 config file I should look at to see if my changes are doing anything? Thanks in advance!
@a.single.drop: What's the output of these commands?
  1. ps wwaux | grep apache
  2. stat /path/to/wp-content