• Skip to main content
  • Skip to primary sidebar
  • Advertise

Computer Tips And Tricks, Gadgets, How-To, Life - 2.0 Style

Get latest technology updates and computer tips and tricks.

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

September 24, 2009 by Gautam

Today I moved one of my site to a new server and when I tried uploading an image I got this error :

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

The parent directory is 2009 and uploads is ‘super’ parent directory (if I can call it that way). Both the directories had 777 permission so there was nothing wrong with the permission settings.

The problem was not with the directory permissions, but it was with URL where WordPress was trying to upload the image.

On my previous server, I had the blog in a folder named ‘tech’ and in the new server I had renamed it as ‘technology’.

Since I had moved the complete blog to the new server, the upload path was pointing to :

/home/tech/public_html/wp-content/uploads/2009/09

instead of pointing to

/home/technology/public_html/wp-content/uploads/2009/09

Do you notice the source of the problem ?

How can you fix it ?

Simple,
Login to your Blog as admin, go to Miscellaneous under Settings.

You’ll find the option “Store uploads in this folder” Set it to default which is “wp-content/uploads“, unless u specifically want the content in some other folder.

This should solve your problem !

There is a more complicated way of changing the file upload path of your wordpress blog, this is recommended only for those who know how to handle wp-config file !

For this you’ll have to modify wp-config.php file. Add below mentioned code before

require_once(ABSPATH.’wp-settings.php’); code in your wp-config file

define(‘UPLOADS’, ‘wp-content/new_folder’);

Once you save this new configuration all your uploaded files will go to the ‘new_folder’ under wp-content directory.

Filed Under: How To's, Troubleshooting Tagged With: file upload path worpress, wordpress upload path

Reader Interactions

Comments

  1. Ankur Jain says

    May 26, 2016 at 5:03 pm

    Thanks for the solution, its the important part with permission issues to check.

  2. Subrata says

    November 8, 2012 at 11:35 am

    @Merv

    Merv :
    Thanks for the tips. I moved my blog from one server to another and your tip fixed the problem. But the fix is located in settings > Media. not “Miscellaneous” in WP 3.1

    Thanks..really its help me..

  3. ????? ??? ???? says

    April 8, 2012 at 2:57 am

    thxx it’s solved

  4. Tom Coady says

    April 7, 2012 at 2:29 pm

    oh yes, that’s ironic – at least it didn’t strip the space after define which I think is still useful.
    I wonder if this will work?:
    define ('UPLOADS', 'wp-content/new_folder');

  5. Gautam says

    April 6, 2012 at 9:47 am

    @Tom – Thanks. Guess the default wordpress editor changed it to a quote.

  6. Tom Coady says

    April 5, 2012 at 9:52 pm

    define(‘UPLOADS’, ‘wp-content/new_folder’);
    did NOT work for me. Perhaps you can change this to

    define (‘UPLOADS’, ‘wp-content/new_folder’);
    (the difference is the single quote is an apostraphe!

  7. arivin says

    March 16, 2012 at 7:17 am

    thank you master
    hehe .. finally I was able to upload photos

  8. fidu says

    February 1, 2012 at 7:27 pm

    thanks it worked for me,

    eep up the good work

  9. Kristoffer Fons says

    December 29, 2011 at 6:17 pm

    Wuhuu! Thanks a lot. I too found your link in the WP-forum 🙂

  10. Sonny says

    December 19, 2011 at 11:25 pm

    hi, just came to say thank you. I found your link in wordpress forum

  11. Mike says

    November 7, 2011 at 10:39 am

    Thanks heaps – this solution worked for me. Appreciate you sharing this.

  12. nic says

    October 27, 2011 at 4:24 am

    The fix worked. and a HUGE THANK YOU to Merv – I was lost and then read your comment. Fixed quickly when located. Thanks .

  13. Dean says

    August 14, 2011 at 9:32 am

    Merv :
    Thanks for the tips. I moved my blog from one server to another and your tip fixed the problem. But the fix is located in settings > Media. not “Miscellaneous” in WP 3.1

    Thanks for the new location

  14. Catzie says

    June 3, 2011 at 11:21 am

    This helped. Thank you.

  15. Merv says

    May 27, 2011 at 1:54 pm

    Thanks for the tips. I moved my blog from one server to another and your tip fixed the problem. But the fix is located in settings > Media. not “Miscellaneous” in WP 3.1

  16. kermit the frog says

    April 12, 2011 at 9:57 pm

    Thanks, it worked for me!!! I had that error when trying to load the /wp-admin page, so the only fix that worked was “the more complicated way”.
    Keep up the good work

  17. city says

    February 7, 2011 at 10:11 am

    Hi, where can i find the wp-config.php? i face this Is “its parent directory writable by the server?”
    i’ve tried the 1st method but it does not work ><

  18. Mitch says

    February 3, 2011 at 4:17 am

    This solution worked. Thanks

  19. Renel says

    November 26, 2010 at 9:59 pm

    Make sure that your php safe mode is “OFF”. Problem will then be solved. Good luck all.

  20. Rhonda says

    October 30, 2010 at 9:21 am

    Thank you so much for this solution! I was banging my head against the wall trying to figure out why it was looking at the wrong directory when I was installing the plugin. You saved me hours of work 🙂

  21. Gautam says

    October 12, 2010 at 2:57 pm

    @Jessen – Welcome.

  22. Jessen Felix says

    October 12, 2010 at 2:31 pm

    Removing the slash really works. I am glad to find this post. Thanks!

  23. Gautam says

    October 2, 2010 at 9:11 pm

    @Les – May be what you suggest works, but doesn’t mean that this doesn’t work out. I’ve experienced this problem and this solution worked for me. It has helped a lot of others who’ve commented about the same.

  24. Terrible Advice says

    October 2, 2010 at 10:02 am

    This was the worst advice possible. Just check your storage limits and see if you have exceeded them. This is probably the case! Don’t change your WP-CONFIG file – this will screw some shit up for sure!

  25. Larry Rivera says

    August 26, 2010 at 8:38 pm

    Thanks a bunch,

    This was driving me crazy, ultimately I had the same problem someone else did.

    I transferred my blog to a new hosting company. I had /wp-config..

    Same thing I should have only had wp-config without the slash when I made the change it worked.

  26. Tips Dan Trik Komputer says

    August 26, 2010 at 8:29 am

    That was really help, i had that problem too before..
    thx for ur share.

    i write it too with my language.
    http://www.tipstrikkomputer.com/wordpress-error-tidak-bisa-upload-gambar.html

  27. bunnyisgood says

    August 18, 2010 at 12:18 pm

    Thank you very much! I was desperate to solve this problem until see your site.Changing code is really useful for me. Thxxxxxxxxxxxxxxxxxxxxx

  28. Safudin says

    August 13, 2010 at 9:25 am

    Thanks for the tips. It really works!!!

  29. Arran says

    August 11, 2010 at 4:49 am

    Awesome! After lots of searching this worked. My host must have swapped the website from home/ to home2/ !!
    Cheers for the solution.

  30. Stephen says

    July 23, 2010 at 8:06 am

    For me I had to make sure the file was there. It was under wp-content/uploads and i didn’t have that file. I got rid of the /uploads and it worked!

  31. Gautam says

    July 16, 2010 at 11:01 am

    @andy – if there’s no content, then it surely will save your time if you install everything from fresh. Sounds like a better option at this point when you are not able to find the right solution.

  32. andy m says

    July 16, 2010 at 6:55 am

    I guess i’m next to jump on the wagon. Working on my dad’s site and having this issue. I’ve double checked all spelling and punctuation. I’ve deleted folders and tried again, i’ve tried different names. I’ve made sure all permissions were set to 777 for every folder in the hierarchy of the blog (i’ve done this through Fillezilla and then even logged into his Plesk Control Panel, and checked in their file manager). I modified the wp-config.php file, which for some reason didn’t do anything. It didn’t change directories or anything. Not sure if stuff has changed since we just upgraded to WP3. Anymore ideas?? He doesn’t have any post, so should I just try killing everything and reinstalling?
    thanks for any help

  33. Gautam says

    June 30, 2010 at 1:30 pm

    @Melissa – Glad it helped you. For a newbie, it becomes a mystery handling these things the first time. Next time around, you’ll surely solve your problems much quicker 🙂

  34. Melissa says

    June 30, 2010 at 9:40 am

    Thank you, thank you, thank you! I’m new to WordPress, CSS, and PHP and I could not figure out what was going on. Solved my problem right away. 🙂

  35. Lisa says

    June 28, 2010 at 11:05 pm

    changing wp-content/uploads permission to 777 fixed mine.

  36. Gautam says

    June 18, 2010 at 12:26 pm

    @Atur – Glad you found the post informative.

  37. Atur says

    June 17, 2010 at 2:20 pm

    Thanks, the blog is Informative and very helpful

  38. NJ says

    June 15, 2010 at 3:36 pm

    my problem when upload thumbnails is..
    The uploaded file could not be moved to /var/www/vhosts/webwisepreview.com/httpdocs/demosite/wordpress/wp-content/uploads.

    anyone can help?
    everything is 777

  39. Tim says

    June 10, 2010 at 1:07 am

    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:

    chcon -R -t httpd_sys_content_t

    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.

  40. Khalil says

    May 21, 2010 at 10:18 pm

    THX MAN U AWESOME 🙂

  41. mike says

    May 20, 2010 at 8:26 pm

    geeeez! all the problem was that it should say “wp-content/uploads” and NOT “/wp-content/uploads”

    that off the “/” in the beginning. what a world of hurt because of that slash.

  42. Scott says

    May 8, 2010 at 5:47 am

    Thanks! This saved me a lot of time and aggravation. I kept trying to change all variations of 777 permissions for my upload folders etc and was pulling my hair out. awesome post.

  43. Girts K says

    March 30, 2010 at 5:34 pm

    All is in Setings > Miscellaneous > type correct path to folder….

  44. Dianso says

    March 22, 2010 at 10:59 am

    thanks 😛

  45. maria says

    January 14, 2010 at 10:35 am

    I have the same problem…I changed the permissions to 777. I checked the path and its correct and I did the above and got the error:

    Warning: Division by zero in /Library/WebServer/Documents/wordpress/wp-config.php on line 77.

    Any more solutions?

  46. Wilzichi says

    January 2, 2010 at 9:07 pm

    I have done all the tips above, but it still doesn’t work.
    And now , on top of it appear “Warning: Division by zero in /home/a4866193/public_html/wp-config.php on line 76”

    Have any other idea?

  47. Kristian says

    November 23, 2009 at 12:58 am

    @Jitendra
    @Zoubayda

    If messing with the wp-config.php still doesn’t do it, go to the Admin Dashboard, Settings, Miscellaneous, and delete the wp-content/uploads and untick organize by month/day. Save the changes.

    Then, add new post, insert image, go back to Miscellaneous. tick the organize by month/day. Save the changes. Hope it works. 🙂

  48. Gautam says

    November 20, 2009 at 8:52 pm

    @Zoubayda – Have you checked the directory path – Most of the time it is the directory path that is not right, even a small spelling mistake can create this problem. If you are sure that the Directory path is correct, then please use the second method of over-writing your wp-config file and it will definitely solve your problem. Make sure you take a back up of wp-config file before you edit it, you’ll need it just in case some thing goes wrong.

    If you still have problem, please do get back and lets see what can be done. According to me there should be no problem.

    Cheers.!

  49. zoubayda says

    November 20, 2009 at 12:55 am

    please i need help
    i am facing problem …that i can’t upload small imagine or video om my wordpress blog i am receiving this error:
    for upload image error is
    Unable to create directory /var/www/vhosts/zoubaydasoudi.com/httpdocs/wp-content/uploads/2009/11. Is its parent directory writable by the server?
    i have check the L Miscellaneous under Settings.
    You “Store uploads in this folder” Set it to default which is “wp-content/uploads“,
    …

  50. Gautam says

    November 7, 2009 at 1:05 pm

    Which version of WP are u using Jeremie ? strange that you encounter a problem when u try to link an image ! never face such an issue… may be it’s temporary .. may be the WordPress installation files are corrupt for some reason .. May be taking a back-up of the database and re-installing wordpress fresh might help. Not really sure what the problem is !… Can you tell me when was the first time you experience this problem ? Did you move your blog to a new server and since then experiencing this problem ?

  51. Jeremie Wade says

    November 5, 2009 at 10:21 pm

    I’ve tried all the tips list above and nothing works for me.

    I can’t upload photos and when I’m navigating the Add Image pop-up (where you can either upload, use an outside link, or go to your media library) to add an image from the media library it gives me a 404-ish OOPS! Page Not Found.

    I’ve double checked the default folders and permissions and nothing seems to be working. HELP!

  52. Jonas says

    November 3, 2009 at 8:23 pm

    Thank you Gautam for the answer.
    Worked out. the folder had to be named “uploads” and not “Upload” as I did and the permissions where to be 777.
    Then for the importing I had to retry several times, untill all the images were imported.
    (http://myblog.files.wordpress.com/2009/09/dscn8364.jpg… Remote file error: Remote server did not respond)
    Thanks.

  53. Gautam says

    November 3, 2009 at 9:41 am

    @Jonas – I think the problem is with the URL. Have u tried following all the steps mentioned in the post ? I had a similar problem, and realized that the directory was pointing to old structure and not the new one. Once I changed the path to the correct, current directory everything worked fine. I suggest, you must try playing around with the directory path and that should solve your problem, or best is to follow the steps mentioned in the post, it should solve your problem. If the problem still persists, let me know and we can dig deep and see what the actual problem is.

  54. Jonas says

    November 3, 2009 at 4:53 am

    @Rosaleen,Gautam – Same problem here. I started WP new on my server and wanted to import my wordpress.com blog. However it keeps telling me:
    “Unable to create directory /home/httpd/vhosts/blog.jonas/httpdocs/wp-content/uploads/2009/11. Is its parent directory writable by the server?”
    Any ideas? – Thank you!

  55. Gautam says

    October 30, 2009 at 5:20 pm

    @Rosaleen – Is your blog on the main domain or subdomain or any other sub-folder ? The above options should work, if nothing works, modifying the wp-config file should definitely work. Let me know if the problem still persists, we can do a remote session and figure the problem out.

    Cheers.

  56. Rosaleen says

    October 30, 2009 at 3:13 am

    eeek..this hasnt worked for me. i’ve tried a few folders (wp-content/uploads, /wp-content/uploads, http://myaddress.com/wp-content/uploads, etc) but nothing…
    i had also tried changing the permissions on the folders and that didn’t work either. any other ideas?

  57. Gautam says

    October 21, 2009 at 8:39 am

    @Gilank – Welcome

  58. Gilank says

    October 21, 2009 at 7:19 am

    Thanks, your tutorial for this code -> define(’UPLOADS’, ‘wp-content/new_folder’);

    very useful once again thanks from indonesia 🙂

  59. John says

    October 20, 2009 at 10:36 pm

    Thanks for the post. This worked perfectly for me. DreamHost switched servers on me but the root directory didn’t get changed properly.

  60. Gautam says

    October 19, 2009 at 11:23 pm

    @Jitendra – If you use the first method, then you don’t need to tamper wp-config.php. Try using the first option and if you still continue to face problems, then try the second method listed. If you have issues with either, please get back !

    Thanks

  61. Jitendra says

    October 19, 2009 at 8:01 pm

    PHP Error Message

    Warning: Division by zero in /home/xxxxxxx/public_html/wp-config.php on line 81

    line 81

    define(’UPLOADS’, ‘wp-content/uploads’);

    help please

  62. Shibu says

    October 16, 2009 at 9:40 am

    Hi Gautam,
    Thanks for the tip,by the way what if I am storing my images in another folder say img.domainname.com?

    Posting images in above said folder is working fine with WLW but not with WP.Any clues?

  63. glady says

    October 2, 2009 at 10:30 am

    thanks! been cracking my brain on how to fix this. hehehe

  64. Darren White says

    September 28, 2009 at 5:59 pm

    Thanks, saved me loads of time figuring what was wrong when trying to do an import

  65. Gautam says

    September 24, 2009 at 11:40 pm

    @Googleverse – But server looks for files based on absolute or relative path. Under what circumstance would it look / search for files ? An example would be …

  66. Googleverse says

    September 24, 2009 at 11:38 pm

    Simple. Server has not to search for theme files inside large folder. Server utilization is reduced as it knows where to look.

  67. Gautam says

    September 24, 2009 at 10:21 pm

    @Googleverse – care to explain how it effects performance. Curious. Thanks.

  68. Googleverse says

    September 24, 2009 at 9:44 pm

    One tip . I would like to give is that make some CUSTOM folders inside uploads folder. And in that custom folder you can keep really large files, big theme images and other things. Now after some time when your upload folder becomes considerably large (in 4-5 years), the number of items wont affect the performance.

Trackbacks

  1. Unable to install plugin for wp blog says:
    November 15, 2010 at 10:30 pm

    […] 0 Times in 0 Posts If that fails – have a look at this Unable to create directory /wp-content/uploads/2009/09. Is its parent directory writable by the serv… Reply With Quote […]

Primary Sidebar

Copyright © 2023 · Magazine Pro on Genesis Framework · WordPress · Log in