• I have a local version of my site running properly (MAMP Pro), and existing media links within posts display as desired.

    The media files are present on my local server in the correct year/month directories. However, when I access the media library through the WP back end, funkiness happens:

    1. all images show a default grey page icon, and their URLs point to the live server.
    2. cannot create a featured image for any post. When I assign an image from the library and save, the selected image fails to associate with the post.
    3. I can’t upload an image from an uploads child directory on my local server. Each effort produces an error, with “The uploaded file could not be moved to wp-content/uploads/2014/XX”

    This last behavior makes me think there’s a permissions issue involved, but I’m no expert there.

    Meanwhile, I’ve successfully updated media links within the local database (using phpmyadmin), but that had no impact on the items within the media library.

    Any thoughts or input is greatly appreciated!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter DaveLindberg

    (@davelindberg)

    I’ve found this post on upload folder permissions which works to a degree. At least now I can re-upload existing images to a directory on my local site and use them for design purposes.

    Still not sure why my current media items in their respective year/month folders aren’t recognized on the localhost system. But I’m letting it go and moving on…

    I have a local version of my site …

    When you moved it to the MAMP Pro local location, did you run a search and replace on the database to update the URLs?

    These are the two tools I always use and have never had an issue:

    http://wordpress.org/plugins/velvet-blues-update-urls/

    — select all options EXCEPT the last one (GUID)

    http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    After running then, got to Settings > Permalinks and just re-save.

    Thread Starter DaveLindberg

    (@davelindberg)

    I did run a search & replace function through the database. That correctly updated links to media items within posts.

    The odd behavior here seems limited to the media library view:

    Funny, no?

    Did you try just re-saving your permalinks?

    Thread Starter DaveLindberg

    (@davelindberg)

    Just gave that a try: changed Common Settings from Default to Post name. No impact on media library items.

    It was an interesting idea though. 🙂

    I am running WP locally, not with MAMP but with the systems LAMP setup.

    I tried all the suggestions on this thread and others, a bit of advice, never set permissions to 777 even if you are working locally, it’s a bad practice to get into.

    I created a directory called Sites where I have localhost setup.
    Now you can do: sudo chmod -R a+w ~/Sites
    The -R flag means recursive so you don’t have to give each directory in your Sites directory permissions.

    f you are concerned about security then instead of making it world writeable you can set the owner to be Apache _www but when working on files you would have to authenticate more as admin you are “not” the owner, you would do this like so:
    sudo chown -R _www ~/Sites

    This makes Apache the owner and it’s what finally fixed it so I could upload files to my media library in WordPress. I tried changing permissions to 777 and 755 for my WP install but none of that worked, you have to give permissions to apache or whatever you are using as a server eg: nginx

    Hope this helps

    Also, in your settings, uncheck Organize my uploads into month- and year-based folders

    [ Please refrain from shortlinks here ]

    https://wordpress.org/support/topic/unable-to-create-directory-is-its-parent-directory-writable-by-the-server-1?replies=30

    Look for the comment by nabtron

    I’m new to WP, well I haven’t worked with it in 3 years or so but I’m working on a client project and this is a great solution for them.

    Thread Starter DaveLindberg

    (@davelindberg)

    Aah, yes, that’s just what I needed — a remind to go back and check the basic syntax of my flu URL link to the library.

    Case closed, filed under “shoulda looked there first”

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Media Library Permissions in localhost?’ is closed to new replies.