WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I upload a photo? (16 posts)

  1. sherrylin
    Member
    Posted 8 years ago #

    When i tried to upload a photo, there was an error message:

    Unable to create directory /home/virtual/site21/fst/var/www/html/wp-content/uploads. Is its parent directory writable by the server?

    How should I solve this problem?

  2. mniepert
    Member
    Posted 8 years ago #

    Does your "uploads" folder already exist? I had a similar problem when I aborted the upload (i.e., the folder with the uploaded file existed but the entry wasn't in the database yet) and then tried to upload the picture again. Delete everything in your upload gallery (if you are only in the test process, of course) and delete all subfolders from "uploads". Then try it again.

    Mathias

  3. Ryan Boren
    WordPress Dev
    Posted 8 years ago #

    You need to change the permissions for the wp-content directory so that it can be written to.

  4. mniepert
    Member
    Posted 8 years ago #

    Well, I know for sure that I had extactly the same problem with the "uploads" folder having write permissions for "owner" (and that's sufficient).

    I would not set write permissions for "group".

  5. sherrylin
    Member
    Posted 8 years ago #

    Thank you.

    I've changed the permission, but the same error message still appear...

    what should I do ??

  6. mniepert
    Member
    Posted 8 years ago #

    This worked for me:

    I still assume you are in the set-up phase for WP 2.0 and that you know how to use ftp-clients.

    Delete all pictures from the post interface in WP (i.e., in the picture browser) and delete the directory "uploads" and all of its subdirectories and files via ftp.

    Now create your "uploads" directory manually as a subfolder of "wp-content". chmod this directory "uploads" to 750 (i.e., set permissions to rwxr-x---).

    Try again to upload a picture, it should work now.

    Note that there are other permission issues when using the upload picture function. For example, see http://wordpress.org/support/topic/53862?replies=10

    Mathias

  7. Sherrylin, what numerical value did you change the permissions to?

  8. eattiger
    Member
    Posted 8 years ago #

    chmod -R 777 uploads

    It'll work well.

  9. mniepert
    Member
    Posted 8 years ago #

    777 is insecure and not necessary

  10. 777 is necessary on most server configurations. Yes, it is insecure, but required by most server configurations in order to use the internal cache and upload features, and the backup plugin. So, in case something happens, keep regular backups (at least weekly) on your local computer.

  11. mniepert
    Member
    Posted 8 years ago #

    can you explain which (bad) configurations and why?

  12. Any configuration that I have encountered running PHP as an Apache module has required 777 for directories to be writable by Apache. Server configurations using PHP-as-CGI (a minority configuration) can use more secure permission settings.

  13. eattiger
    Member
    Posted 8 years ago #

    Ok , that's right.

  14. sherrylin
    Member
    Posted 8 years ago #

    I can only change the permission of 'upload' folder. when i want to change the folder '2006' there was an error message;

    Error -142: remote chmod failed

    what does that mean?

    thank you.

  15. maledei
    Member
    Posted 8 years ago #

    this seems to be a general problem, I think.

    I couldn't resolve it with the tips given here, it's always the same answer, no matter what permissions I give, from 750 to 777:
    "Unable to create directory .../blog/wp-content/uploads/2006. Is .../blog/wp-content/uploads writable?"

    I then tried to create the categories manually and gave tem all permission 777, the answer is this:
    "Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 1255 is not allowed to access .../blog/wp-content/uploads/2006/01 owned by uid 30 in .../blog/wp-admin/admin-functions.php on line 1757"

    why aren't we able to set the upload folder manually like before? i've quite a lot of pictures and had my own archiving system.

  16. maledei
    Member
    Posted 8 years ago #

    I just found out that the SAFE Mode Restriction is set by my web-host. I'll have to write a mail asking to deactivate it, and if he doesn't want to, no image uploading. boring.

    but never mind, i just found out that IImage Browser has a wordpress 2 compatible plugin that serves all my needs:
    http://fredfred.net/skriker/index.php/iimage-browser

    one just has to deactivate the WYSIWYG editor to see the quicktag.

Topic Closed

This topic has been closed to new replies.

About this Topic