WordPress.org

Ready to get started?Download WordPress

Forums

image upload problem - parent directory writeable (20 posts)

  1. arminbw
    Member
    Posted 6 years ago #

    Using the wordpress admin/settings/misc page I checked "organize my uploads into month- and year-based folders".

    When trying to upload an image I get the following error message:

    Unable to create directory [...]/uploads/2008/06". Is its parent directory writeable by server?

    Changing the permissions of the upload folder to 777 (just for testing!) leads to the same error message, but this time the directory 2008 has been created by "www-data" (or maybe "nobody", depends on the server).
    Nevertheless, the 06 subdirectory is still missing.

    This is a permission/ownership problem which can be solved - if you have root access - and if you manage to contemplate this mantra:

    When safe_mode is on, PHP checks to see if the owner of the current script matches the owner of the file to be operated on by a file function or its directory. - http://de.php.net/features.safe-mode

    Meaning: if www-data executes your scripts (owned by you, not www-data) wordpress will create a year-directory which is owned by www-data. Afterwards it will create the month-subdirectory, but now the owner of the script (you) does not match the owner of the directory (www-data) it operates on.

    Changing the owner of all WordPress files to www-data should do the trick, but isn´t really an option. Just changing only the group-ids, while turning safe_mode_gid in the php.ini file on should work.
    But actually turning php safe_mode off seems to be the way to go.

    Hope this helps some people who encountered the same problem,
    Armin

  2. adunate
    Member
    Posted 6 years ago #

    I'm not a coder by any means and don't fully understand your instruction. Can you be more simplistic for dummies like me? :-)

    Do I change the ownership of my WordPress files in my wordpress file administration? Or do I do this within my computer (referring to "when safe mode is on")

    Is there a step-by-step instruction somewhere?

  3. adunate
    Member
    Posted 6 years ago #

    OK. If you stick to it long enough you can answer your own question.

    I found this page helpful. But his instructions to right-click didn't apply to my mac or ftp program, whatever. Instead, I selected the folder (which by the way I had to create because there was no uploads folder in this 2.5 version)and then went up to the ftp menu bar to Get Info.

    In there was the option to change permissions from 755 to 777.

    I did this also to the 2008 folder I created and the 06 folder. I now can upload images in the 2.5 version.

  4. arminbw
    Member
    Posted 6 years ago #

    Sorry, I can´t give any step-by-step instructions, because this really depends on the configuration of the server you are using. Safe_mode is an more or less outdated security feature of php. And things like disabling php safe_mode, installing fast_cgi or changing user-groups can only be done by the administrator of the server.

    I guess the work-around you used (granting every user on the server read, write and execute permissions) is the simplest way to get things working. But beware! The next month wordpress may fail creating a 07 folder. In this case disabling the "organize my uploads..." checkbox in WordPress would be necessary.

    To check if safe_mode is turned on you could write a small text-file containing the following lines:

    <?php
    phpinfo();
    ?>

    Name it phptest.php, upload it to your server and run the script by using your browser. Then search for the term "safe".

    Armin

  5. Romik84
    Member
    Posted 6 years ago #

    This has absolutely nothing related with the SafeMode or any permissions CHMOD. I'am using 2 servers. On both are installed wp 2.5.1. Both are same configured and one works and second doesn't work and writes error: "HTTP error." So where is the problem now? Will WP staff help us?

  6. arminbw
    Member
    Posted 6 years ago #

    This has absolutely nothing related with the SafeMode or any permissions CHMOD.

    Well, the world is full of errors. In this post I addressed the "parent directory writeable by server" problem, not any http issues. Try a search is in this forum (read this), use the no-flash-uploader. Good luck!

  7. Romik84
    Member
    Posted 6 years ago #

    I have already solved the problem and it's a WP bug. I wrote that here and here

    Go to General Settings and in WordPress address URL field leave: http://yoursite.com. This one is wrong: http://www.yoursite.com.

    problem solved...

  8. Kindaichi
    Member
    Posted 6 years ago #

    Change File Permissions of wp-content to 777.

    Remember it is NOT changing File Permissions of wp-content/uploads.

    Note the difference between the two folders.

    Instructions on changing file permissions,

    http://codex.wordpress.org/Changing_File_Permissions

  9. arminbw
    Member
    Posted 5 years ago #

    * sigh *

  10. BHopkins
    Member
    Posted 5 years ago #

    I was able to fix mine.

    Under Settings > Misc > I totally deleted everything in the "Store uploads in this folder" box. Underneath that box it says, "Default is wp-content/uploads". My box had something totally different.

    When I removed everything from that box and saved it, it immediately worked, no chmod'ing anything.

    I have a dedicated server and my site is working great at my free web hosting site.

  11. phinux
    Member
    Posted 5 years ago #

    I have a similar suggestion to one that was posted here. This should apply most specifically to sites running on Linux/Unix servers.

    In your WordPress Admin area go to Settings, then Miscellaneous. If the directory is set to /wp-content/uploads change it to wp-content/uploads. In a Unix environment that might be telling it to look for the folder in the root directory, which normal users usually do not have permission to use. If you take out the first slash it should tel it, from the current directory, look. for wp-content. This may not work for everyone, but it's one possible solution.

  12. appanews
    Member
    Posted 5 years ago #

    I have just had the same issue. My WP installation for some reason just would not allow me to upload media files.

    I went to SETTINGS in WP, deleted the path in the uploads field, leaving it blank. Saved the changes.

    Problem solved. I am now able to upload.

  13. arminbw
    Member
    Posted 5 years ago #

    There are myriad different causes for upload problems. The problem discussed above is just one of them.

  14. ketchapay
    Member
    Posted 5 years ago #

    Experienced the same problem, I'm getting this error message when uploading images:

    Unable to create directory /var/www/vhosts/xxx/httpdocs/wp-content/uploads/2009/01. Is its parent directory writable by the server?

    wp-content has the permission 777 and uploads has 777 as well. I don't see it even creating the directory '2009' inside 'wp-content/uploads'. The settings are all default.

    I'm using WordPress 2.7

  15. jimbo40010
    Member
    Posted 5 years ago #

    I did the same thing as appanews. You have to make sure you have actually created the uploads folder and chmoded it to 777

    In UNIX or Mac OS X this is done with the following command (make sure you are in the wp-content folder already...

    mkdir uploads
    chmod 777 uploads

    Wierd....

  16. jimbo40010
    Member
    Posted 5 years ago #

    One addition, this can also happen if you have set a webdav realm on your site with Mac OS X server. To get around it, I made a new realm called uploads so that www could upload to the uploads folder.

  17. DIYer
    Member
    Posted 5 years ago #

    Tx, BHopkins, this worked for me :

    Under Settings > Misc > I totally deleted everything in the "Store uploads in this folder" box. Underneath that box it says, "Default is wp-content/uploads". My box had something totally different.

    Roki84, interesting what you noted :

    Go to General Settings and in WordPress address URL field leave: http://yoursite.com. This one is wrong: http://www.yoursite.com.

    I had to change & keep my URL to http://www.yoursite.com, because I entered it that way into Google Webmaster tools, loaded the sitemap & Google indexed the WWW URL. So changing that could have something to do with this FRUSTRATING problem!!

    THANKYOU BHOPKINS, I lava ya!!!!!!!!!!!!!!!!!!

  18. mikeall
    Member
    Posted 5 years ago #

    I fixed it using the info reply from BHopkins which says:

    Under Settings > Misc > I totally deleted everything in the "Store uploads in this folder" box. Underneath that box it says, "Default is wp-content/uploads". My box had something totally different.

    When I removed everything from that box and saved it, it immediately worked, no chmod'ing anything.

  19. recetasdepostres
    Member
    Posted 5 years ago #

    I need to reiterate as well - this is your fix:

    Under Settings > Misc > I totally deleted everything in the "Store uploads in this folder" box. Underneath that box it says, "Default is wp-content/uploads". My box had something totally different.
    
    When I removed everything from that box and saved it, it immediately worked, no chmod'ing anything.
  20. neocamel
    Member
    Posted 5 years ago #

    I doubt this solution would work for everyone, but what eventually solved this issue for me was to specify the full path to the image folder, ex.
    http://www.yourwebsite.com/wp-content/images
    or whatever the complete path to your images folder is too. I also have permissions set to 777 for that folder.

Topic Closed

This topic has been closed to new replies.

About this Topic