Unable to create directory wp-content/uploads/2013/08. Is its parent directory writable by the server?

August 11, 2013 33.3k views
Hello I have been trying to upload an image into my Wordpress dashboard without success. Every time I try to upload the image, I get an error like below: Unable to create directory wp-content/uploads/2013/08. Is its parent directory writable by the server? I am using CentOS 6.4 with latest Wordpress. My WP is located in /dir1/dir2/dir3/wordpress, and below this, wp-content has "uploads" directory and within this 2013/08 directories. Additionally, I had to create uploads/2013/08 as they did not exist in the original installation process following the instructions from DO. I have changed permission and that too did not work. Same upload error shows still. This is what I do to see the error from Wordpress: 1. Dashboard --> Pages --> 'Add Media' 2. Dashboard --> Media --> 'Add New' As mentioned, uploading an image shows the error stated above regardless of which image I choose. I have not had any problem installing themes or plugins, just the problem with image upload. I have rebooted my host, also, and retired image upload without success. My host has LAMP (CentOS) and WordPress. Please could you suggest a fix for this kindly. Thank you.
25 Answers
Run the following command as root:

chmod -R 777 /dir1/dir2/dir3/wordpress/wp-content/uploads


That should fix it.
Yeap, have done that...and also done this:

chgrp -R apache /dir1/dir2/dir3/wp-contents
chmod -R g+w /dir1/dir2/dir3/wp-contents

Got directories to look like this:

drwxrwxrwx 5 apache apache 4096 Aug 10 15:23 wp-content
drwxrwxrwx 3 apache apache 4096 Aug 10 15:27 uploads
drwxrwxrwx 3 apache apache 4096 Aug 10 15:27 2013
drwxrwxrwx 2 apache apache 4096 Aug 10 15:27 08

Then retried uploading image again, and still not joy...
Hmm, try deleting the 2013 and 08 directories you created and have Wordpress create them.
This work for me in Ubuntu - use sudo/su, I am not sure about the name of the httpd user - perhaps this is the issue

sudo chown -R www-data:www-data /var/www/your_site_dir
sudo chmod -R 775 /var/www/your_site_dir
Ok. So after a couple of days I have the same problem. Anyone have an idea I already tried all of the above.
@chupa: Is it working for you or not? I'm not sure what you mean.

You said
This work for me in Ubuntu - use sudo/su, I am not sure about the name of the httpd user - perhaps this is the issue 

But now you're saying you're having the same problem.

Try chmod -R 777 /var/www/your_site_dir/wp-content/uploads as root -- does that fix it?
I tried to answer ensign.yc198 question, but I am not clear enough. Actually I was forgot about this question here and then today - BAM - this annoying problem happen to me. And I got here from google looking for solution as I was sure it is nor permission or owner.

I feel stupid now - my problem was that this was moved installation, and all I had to do is to change the folder path under "Settings->Media".
Oh, glad you figured it out! :]
to FTP server / right-click 'wp-content' and select 'File Permissions' A popup screen will appear. Then click OK.
sorry!

to FTP server / right-click 'wp-content' and select 'File Permissions' A popup screen will appear.add the check boxes, you should get 777. Then click OK.
Dear,

I am facing this problem when uploading a new theme.

After try chmod 777 and chown, the message "Unable to create directory wp-content/uploads/2013/08. Is its parent directory writable by the server?" gone, but Wordpress said like below:

"To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host."

Thank you,
Tien Nguyen
@Kamal Nasser

Have any solution for the above problem?

Thank you.
@nguyentien.jobs: This was solved -- please read the previous comments, especially "August 17th, 2013 13:33" and "August 17th, 2013 22:02".
It's actually an acl issue and not a permissions issue as you would first suspect. You have to set the acl option on the file system hosting your web server, and do it in the /etc/fstab file so it will survive reboots. The line in my /etc/fstab looks like:

UUID=397966d0-61eb-4ef4-8ffd-10b6c06964dd / ext4 defaults,acl 1 1

Next, remount the file system as follows for acl's to take effect:

mount -o remount /

Next, set an acl on the parent directory for uploads. In my case, it's as follows:

setfacl -R -m u:apache:rwx /var/www/html

Next, check to make sure that 'apache' has rwx access to the directory:

getfacl /var/www/html

You will see an entry displaying that 'apache' now has access for that directory, and it will look like the following in the output:

user:apache:rwx

Now, you can go into Wordpress, and all should be well.
Would it work if you just reinstalled a fresh copy of wordpress or is it more than this?
Being a person with little knowledge of computer science etc I am a bit out of my depth
@andrewabarker: Even if you installed a fresh copy of wordpress it's likely that you will still have permission/acl issues.

It really depends on the OS you're using. On Ubuntu you should be good to go if you set the correct permissions
I'm having the same Error when trying to change a Wordpress Theme or upload an image file...failed to upload due to an error Unable to create directory wp-content/uploads/2013/11. Is its parent directory writable by the server?
Im running WindowsServer 2008R2, MySQL 5.6.14, PHPMyAdmin 4.09 and Wordpress 3.7...Please help been looking for days to resolve this
@tom: Sorry, I'm not familiar with Windows Server. Try this.
Changing permissions of the uploads folder to 777 isn't really ideal.

For me it was just a ownership issue. On centso I did the following, to change ownership of the site to Apache.

sudo chown -R apache:apache /var/www/html/site_name/
sudo chown -R apache:apache /var/www/html/site_name/

That was it!!! I've spent many hours on this problem. Thank you!!

For those of you where changing the directories to 777 does not work, then this may be your problem. I just replaced the path with my own and then: service httpd restart.
You simply open up filezilla and make sure all the file permissions are right on each folder that you want to write to.
for some reason you have to set public permissions to write in order to get it to work? Maybe this is opening up to security threats but honestly, I am just happy that I am finally able to write to the folder
woops Im totally wrong on that one

Isn't 777 a bit of a security risk?

Have another answer? Share your knowledge.