Troubleshoot: Unable to create directory+Is its parent directory writable by the server?

by dave on May 13, 2009



Most often when you change your host and move your wordpress blog from one host to another, there are many small things that may create problems and may not make the moving experiance a pleasure. One of such problems is that you can not upload your image in your posts. Here is the error that you may receive:

Unable to create directory /xyz/public_html/wp-content/uploads/2009/05. Is its parent directory writable by the server?

What does this error actually mean? It means either the above given path is not correct where the server wants to write the image OR the server itself does not have the permissions (CHMOD) to upload your image?

Now first see if you have the correct path provided for the upload of content. Login to Wp-admin, click on Settings and then choose Miscellaneous option from the left menu

wordpress-misc-settingsIf you have moved from your old server, you would instantly know that you are using wrong path. Change the path now; most probably it should be wp-content/uploads (if your wp-content is in root directory). Save the changes and it should start uploading right away.

Now if you have corrected the path but still it is showing the problem you may consider revising permissions from any FTP client. Right click on Wp-content folder and then select ‘Properties/CHMOD’. You shall see the following window:

wp-content-properties

Make sure that you assign 755 as the permission value. Remember not to ever give 777 value as that has its own security risks. Once you save these settings, it should certainly work. Share your experience with us after solving the issue :)

Related Articles:

  1. WAMP SERVER error: localhost goes to www.localhost.com
  2. PhotoVisi – Create Collages from Your Photos in Few Clicks
  3. Take time off, Create your beat with MOG
  4. Domain Name Server.com Sold for $770,000
  5. Create Custom Comic Books with Apple’s New Invention
  6. Service Pack 2 for Vista & Server 2008 – Coming Soon



{ 42 comments… read them below or add one }

Jyoti May 16, 2009 at 1:39 am

Hello Mansoor,

I stumbled upon the ‘Unable to create directory’ error when trying to upload media in WP 2.71. Your article helped me resolve this irksome error without having to meddle with permissions. I must add that this is the most succinctly written troubleshooting article on this error. THANK YOU!

Reply

mansoor.ehsan May 16, 2009 at 7:33 am

Thanks Jyoti for visiting our blog. keep visiting for future reference.

Reply

Darmawan May 22, 2009 at 4:17 pm

A good article, I already solve the problem

very..very thank’s

Reply

tan June 10, 2009 at 11:51 am

hey, have the same problem. but..no results..doing the same what u said… :( (( i just updated to the latest version of WP. help

Reply

Mansoor June 10, 2009 at 5:54 pm

hey @tan, have you recently shifted your hosting service or changed your directory for upload?

Reply

Bob June 11, 2009 at 5:20 am

Nothing worked for me .
Maybe it’s not permission problem .
Maybe it’s not htaccess problem . and
Maybe it’s not wp-content/uploads url problem.

It’s just a bug haven’t be fixed for me !

Reply

Toby June 19, 2009 at 9:17 pm

This post saved the day for me! I was trying to mess with my permissions, when the problem was that the ftp user was set incorrectly in that uploads folder screen.

Thanks!

Reply

MJK June 20, 2009 at 7:36 am

We are happy that our blog post helped you. Actually Mansoor.Ehsan wrote this post after we faced it ourselves after change of host.
I went through your site and its good. Do not forget to subscribe to our RSS to stay in touch with TN

Reply

Yusriel June 22, 2009 at 3:31 am

nothing works with wordpress 2.8, permission change with 777

Reply

Matt August 12, 2009 at 10:35 pm

Hey nice fix, you got me up and running again in mere seconds. THANKS!

M

Reply

Rambabu August 21, 2009 at 11:33 am

Thanks a lot. I was searching for the above problem, With your suggestions, i could able to upload the images successfully.

Reply

Eric September 3, 2009 at 6:18 pm

Thank you!

Reply

JAZZ September 14, 2009 at 5:48 pm

Nothing work for me too..
i use wordpress 2.8

Reply

JAZZ September 14, 2009 at 5:58 pm

Actually i found solution…

—>url blog/wp-content/uploads

—>change the permission of your (uploads) directory to 777

if you are using an FTP software like FTP pro or Filezilla right click the folder and select Properties..

But otherwise, thank you for sharing this tip..

Reply

Jonathan October 22, 2009 at 12:01 am

Thanks! A great help!

Reply

Jim Smith October 26, 2009 at 7:34 pm

Thanks so much your tips worked great..

Reply

MJK October 27, 2009 at 4:14 am

@Jim! You are welcome

Reply

bus November 16, 2009 at 8:08 am

thanks ,with your help i do it ok

Reply

Chris November 21, 2009 at 5:19 pm

JAZZ: Nothing worked until I read your post. Thanks!

Reply

Pedro November 30, 2009 at 5:56 pm

Thank you, Mansoor! =)

Reply

husain December 6, 2009 at 4:50 pm

i tried what u said above but still i m getting this thing – “Unable to create directory /home/xyz/public_html/wp-content/uploads/2009/12. Is its parent directory writable by the server?”

& m unable to upload any images.

Thanx in advance

Reply

Abi December 16, 2009 at 7:58 am

Delete the “uploads” directory inside your wp-content that should fix the problem
!

Reply

Helga January 1, 2010 at 2:14 pm

Hi,
I had this problem after moving my blog to another directory.

I checked everyting: the miscellaneous settings are okay, the chmod is 755. It only works for me to upload after chmoding the uploads file to 777 which of course I don’t want…
Any idea what else I can try? Can’t leave uploads at 777 of course (insecure) and chmoding everytime i upload a pic takes a lot of work..

Thanks for any help!
Helga

Reply

Thanks So Much January 10, 2010 at 4:20 pm

Such a simple solution for such an annoying problem. Thanks for writing this article, probably saved me a million hours tinkering.

Reply

Dominic January 28, 2010 at 10:35 pm

I’ve just installed WordPress and have this problem. I’ve followed your suggestions to no avail. Is there anywhere I can get help before I bin this?

Reply

Technorotic February 2, 2010 at 12:06 pm

It worked for me, I’ve just have to enter default settings i.e. “wp-content/uploads”. Thanks for sharing

Reply

yeanii March 30, 2010 at 6:59 pm

My site encounter this problem.
Thank you very much

Reply

p99 April 1, 2010 at 10:47 pm

thanks! this solved my problem :-)

Reply

Bleatlessness April 12, 2010 at 7:27 pm

Didn’t work for me, even though the directories “wordpress” and “wp-content” were 755.
I solved it by creating the “uploads” directory in “wp-content” and made sure it was 755 (which is was by default for me).

Reply

MbahDewo April 26, 2010 at 4:57 pm

Thanks, it solve my problem too. Just simply make it “wp-content/uploads”

Reply

Billie April 28, 2010 at 4:48 pm

Miscellaneous settings are correct
Permissions have been changed

Still not getting anywhere – my message is below

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

any other thoughts?

Reply

Diane May 8, 2010 at 1:00 am

Thank you so much. I had no idea what was wrong. What a godsend!

Reply

dude May 22, 2010 at 3:42 am

This bullshit is driving me crazy. F*** you Wordpress.

Reply

agent smith May 23, 2010 at 7:09 am

thanks much! solved the issue asap! cheers

Reply

Piseth June 8, 2010 at 4:46 am

I face the same problem as mentioned in this article and trying to follow and fix it but it seems nothing happened. I wonder why. Is there other way to solve this?

Reply

Tim June 9, 2010 at 7:32 pm

I had this problem and spent several hours reading posts about with no luck. My permissions were right and the upload folder path was correct.

I realised that it was a SELinux issue for me. If you run SELinux then you will need to run the command below to allow apache (httpd) to execute particular PHP commands, including creating new files and folders. Here is the command:

Hope that helps someone else. This was driving me crazy and I was about ready to give up and uninstall WordPress. Glad it didn’t come to that.

Reply

Jason June 22, 2010 at 12:15 am

Thank you so much for this information. It was driving me insane. I couldn’t work it out. As soon as I read your info I laughed. I couldn’t believe I didnt think of that myself. After almost 4days of trying to figure it out. Maybe I should have done a google search earlier (but us men don’t even stop to ask for direcetions). I never had the problem before so I just thought I missed something in the set up. Once again, thank you so much.
Kind Regards,
J P Baker
Australia.

Reply

MJK June 22, 2010 at 11:51 am

You are most welcome Jason

Reply

Brian June 29, 2010 at 12:58 am

This problem cropped up several months ago when I upgraded WP.
I have checked permissions, and they’re fine – set to 755. I also checked the file path in the WP config menu, and it’s fine.
The problem is that a new file (for the current month) can’t be created in the uploads/2010 folder. I see that the owner of the uploads folder is my username.
Any thoughts ?

Reply

Short Sale Software July 1, 2010 at 2:42 pm

I figured it out from another post.

Go back to the settings page. If the directory is listed as “{{/wp-content/uploads}}” change it top “{{wp-content/uploads}}” (get rid of the first slash) and it works.

Reply

KEN July 1, 2010 at 6:29 pm

I have done all of the edits above, I have my permissions set to 755 and then 777, neither will work. Looked to see if there was a / in front of wp-content, there wasn’t. I’m at my wits end with this.

Reply

Guille July 21, 2010 at 2:58 am

This solved the problem I had when trying to upload an image. Another plus, is that it solved other problems I was having with my template.
Thanks!

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: