WordPress 2.8-3.0 file / image upload error fix

While uploading the image to the gallery on WordPress 2.8, i found out that it was giving me this error:

Unable to create directory /the/path/here/.

Is its parent directory writable by the server?

This can be caused by some misconfiguration, including shifting the blog server or directory.

The solution to this issue is simple:

Goto Settings -> miscellaneous

and change what ever value is there in for: Store uploads in this folder to wp-content/uploads

You can notice that on the same page, just in front of that input box, WordPress also says that default is wp-content/uploads

Hope this solves the issue of error saying that the parent directory is writable or not by the server when uploading image file or other file to the media directory.

EDIT 1: Please note, that when you add “wp-content/uploads” you donot write the slash in the begining like “/wp-content/uploads”.

Also, there is upgrade version 2.8.1 for WordPress is available, it includes fixes to many issues already, so try upgrading it first and then see if the error still presists. You can find the post for upgrading your WordPress in the WordPress section.

EDIT 2: (see the edit 3 below before going for this one) If the above does not fix the problem, you need to confirm this:

Goto your site root > wp-content

Check if there is a folder named uploads

If you cannot see the folder, then simply create new folder to it and name it uploads.

Try uploading the image now, if it still doesn’t work then give permissions for this folder uploads to be 777.

If this does not solve the issue , and the uploads folder already exist, check if there is folder named 2009 in it.

If it does exist then simply give permission 777 to all sub folders in the main uploads folder.

Make sure that you return the value to 755 once you have worked on it. For solving this for long term , see the edit 3 below.

Hope it solves the issue.

EDIT 3: User wafwot mentioned this fix and mentioned that it is checked, so try this before attempting to set the permission to 777:

Disabling PHP safe mode will allow the apache user to create subsequent year and month subdirectories in uploads with “Organize my uploads into month and year-based folders” checked. No need for world-writable directories.

If you dont know how to disable safe mode, ask your hosting provider , or post here if you need help about it.

hire best wordpress php css developer
Need Help? Hire me now!
I can help you in anything related to webdevelopment, including: HTML, CSS, PHP & MySql, WordPress (plugins & themes development, others), regular expressions, server management, etc.

40 comments on “WordPress 2.8-3.0 file / image upload error fix

  1. HI there, I tried doing this and it was already set correctly to wp-content/uploads and it still says the same error. any other ideas you may have would be greatly appreciated!
    thanks!

    1. hello tan,

      please make sure it is “wp-content/uploads” and not “/wp-content/uploads

      waiting to know if it was still not solved.

  2. Nabeel . seriusly, who many times are people like you gonna say “check the permissions to be 777”?

    Are you aware that it leaves the server WIDE OPEN to attacks? you make it possible for people REMOTELY to create and exechute scripts…

    1. i appreciate your view sir, but :

      1. take it more like, that “check by changing your permissions to 777, to see if that was causing the problem” or “change the permission to 777 when uploading the files”

      2. changing it to 777 does not mean it is absolutely underattack. It depends upon your server configuration.

  3. hello! yes, it was fixed. thank you for your tip! i just change the permissions back after i make changes to that path in order to make sure it’s secure. your post was very helpful!

  4. Thanks so much Nabeel, I have been searching for the solution for so long . I am a kind of slow in this kind of stuff but you clear explanation made me changed the permission myself-don’t have to ask for help from others. And I changed it back to 755 also.

    Thank you very much again.

  5. Disabling PHP safe mode will allow the apache user to create subsequent year and month subdirectories in uploads with “Organize my uploads into month and year-based folders” checked. No need for world-writable directories.

  6. I never had this problem with 2.7, only after I upgraded to 2.8. I used the 777 fix and within a week my website was hacked by “turkish muslims” accusing American’s of “baby killing”. I had to erase everything from my site and start over from scratch. After re-installing the latest version of wordpress I am getting the same error. My permissions are set at 755, and will stay that way. There must be some other way of fixing this problem. I am a novice at this sort of stuff, and just want to focus on my blog and not all these technical problems.

    Help! I mean real help and not get my website hacked again help. ;)

    1. please ask your server people to turn off safe mode on your account. Also if you need any commercial support in securing your site, do let me know.

  7. Thanks Nabeel. This worked – I did have to put the entire string of the folder address in, but got it to work great after that.

  8. Hello guys,

    The problem is that: when my wordpress create a folder automatically (for example the folder por the pictures for the new month), this folder is created for de USER:APACHE, so WordPress have the problem to upload my pictures, and then I have to delete de folder an create again. What can I do?

    harry—–(at)hotmail.com (email edited by admin to avoid spam to the user)

    This happend after I change hosting.

    Thanks.

    1. are you sure that the hosting transfer was successful? and you made all changes in the db and configuration file?

      also can you please give more details of your host? this would be helpful.

  9. Hi Nabeel,
    Thanks to answer, I’m not sure, because the people from the hosting made the change, and everything is ok, only this problem. In my previous hosting, I used DB_HOST: “locahost” in my configuration, but in the new hosting, they change this to a new DB_HOST: “clud001.****.net”, This is the only change.

    Notes:
    I use Plesk Control Panel.

    Thanks.

    What other details do you need?

    1. i dont have a plesk panel currently, so cant check it, but if you want to fix the issue with folder permission for long, you can uncheck the “organize my uploads in months . . .. . ” in the settings > miscellaneous. this way it will not create new folders every month or so. But if you have some large image data every month, then its better to organize it. i can try to fix it if i get hold of plesk server.(also let me know if you are interested in commercial support from me)

  10. Thanks Nabeel, I have tried every-which-way, and all I was missing was the “uploads” folder.

    (here’s what happened in case it can help someone):
    After trying all the code edit tips and tricks, I started to get a lot of error messages, so I just backed up my “themes” folder, deleted the whole wordpress directory (not the index.php and wp-config.php which is outside of the wp dir) and re-installed it (wordpress). I created a new upload folder like you described (wp-content –>uploads) and set the permission to 7777 via FTP.

    Tank you so much for your help!! Could not have done it without you!

    1. i am glad that it worked for you sir!

      Please note, although this method surely worked for most of the people, it is stated that it might lead to some security issues in some circumstances, so it is preferred that you discuss it with your hosting provider, they might come up with any long term solution, till then, you can continue with this fix, but while keeping complete backup of your wordpress, including files and database.

Leave a Reply

Your email address will not be published.