WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Locally installed WordPress - media library problems (5 posts)

  1. MD84
    Member
    Posted 4 years ago #

    I've installed WordPress on a local server. Now I am having big troubles displaying media files in my media library. Uploading files from the media library do not work, nor do files display in the media library, when manually putting files in the designated map.

    I've tried a couple of things:
    - setting the 'store uploads in this folder' to wp-content/uploads in the miscellaneous subpanel (all check boxes unchecked).
    - setting the 'full url path to files' to http://localhost/panos_cms/wp-content/uploads in the miscellaneous subpanel (all check boxes unchecked).
    - doing both of the above mentioned methods at once

    I simply does not work, can somebody help me? Thanks

  2. s_ha_dum
    Member
    Posted 4 years ago #

    Seems like almost all media uploader problems are permissions related. Exactly what happens when you upload? What kind of server do you have?

    ... when manually putting files in the designated map.

    If you mean that you are putting files in the 'uploads' directory, that isn't going to work. You have to upload via the media uploader to get the right DB entries or the media library won't recognize the images (or write your own script that inserts those DB entries with or without the built in WP functions).

  3. MD84
    Member
    Posted 4 years ago #

    Thanks for answering!

    Seems like almost all media uploader problems are permissions related.

    Okay, but when operating locally do you have to deal with permissions? That seems strange...

    Exactly what happens when you upload?

    This message appears (translated from Dutch): The uploaded file could not be moved to /Applications/XAMPP/xamppfiles/htdocs/PANOS_CMS/wp-content/uploads.

    What kind of server do you have?

    I am using XAMPP on my Mac (I know, it's better to use MAMP). So I'm using Apache as a server.

    If you mean that you are putting files in the 'uploads' directory

    That's exactly what I meant, but okay, that doesn't work.

    So what to do next, instead of writing my own script (this should be my last resort)

  4. s_ha_dum
    Member
    Posted 4 years ago #

    Okay, but when operating locally do you have to deal with permissions? That seems strange...

    Yes. You always have to deal with permissions. Both Mac and Windows kinda hide this fact, though less so than they used to actually.

    Ok. Here is how this works. Your web server is a user and has a username, even if you don't know what it is. That user (the web server) has to have permission to write files to the /uploads/ directory or the media uploader will fail in exactly the way you describe. I don't know if XAMPP has any internal permissions tools but if you browse to the uploads directory in the Finder you should be able to right click on the folder, choose, 'Get Info', and find an 'Ownership and Permissions' menu. You can set everything to 'Read and Write' and that probably won't hurt anything so long as no one can connect to your web server from outside your LAN-- so long as no one can connect from the internet, in other words. You never want to do that to a web accessible server. You probably want to hit 'Apply to Enclosed Items' also. The more security conscious way to do it would be to work out what group the server runs under, switch the folder's group to match the web server's group and then apply write permissions for the group only.

  5. MD84
    Member
    Posted 4 years ago #

    Wow, it works, thanks a lot! I will be careful though!

    For other readers, you might want to take a look at:
    http://codex.wordpress.org/Changing_File_Permissions

    Again, thanks!!!

Topic Closed

This topic has been closed to new replies.

About this Topic