WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Cannot Upload Featured Image In WP (9 posts)

  1. coreymj78
    Member
    Posted 1 year ago #

    I have recently migrated my entire WordPress mulitisite to a new VPS (from a shared space) and I’m now having trouble uploading Featured Images for posts in the wp-admin area.

    I noticed that when attempting to upload a new Featured Image (post thumbnail) from the Add New Post page in wp-admin, it appears to upload / update fine from the Post Edit screen, but on the front-end of my site, it shows a broken image icon next to the actual post. So, something is broken in terms of image uploading. WordPress has the correct directory, but it’s unable to correctly upload and apply new images or create new image thumbnails. The other weird thing is, if I upload an image directly from Media > Add New (instead of the Post Edit area) it will upload the image fine and it actually appears in the blogs.dir / files folder. That tells me that the problem is when WordPress has to create image thumbnail(s) from another file (as when uploading a new group avatar).

    I have taken these steps already:

    1. Verified that all permissions on all folders and files are correct (755 for folders, 644 for files).
    2. Tried various variations of permissions (766, 777, etc)
    3. Verified that the upload folder in All Sites > Edit > Settings options screen is correct for all three fields:

    Upload Path: wp-content/blogs.dir/2/files
    Upload URL Path: http://flooringlifemagazine.com/wp-content/blogs.dir/2/files
    File Upload URL: http://flooringlifemagazine.com/wp-content/blogs.dir/2/files
    Blog Upload Space: (blank)

    Is this all correct? Also, my host has verified with me that my plublic_html folder has my owner rights added to it and is set correctly as well as informed me that PHP Safe Mode is OFF. Can anyone think of anything else I might be missing here?

    Thanks for any help at all.
    Corey

  2. coreymj78
    Member
    Posted 1 year ago #

    Ok, this is weird. So I verified that everything was correct in .htaccess as well as wp-config.php, nothing wrong there. Here's the weird part, I used Firebug to inspect the Featured Image in the the Post Edit screen and it points to the correct file in:

    flooringlifemagazine.com/wp-content/blogs.dir/2/files/room1.jpg

    Then I inspect the broken image of the post on the front-end and this is the link it shows there:

    flooringlifemagazine.com/wp-content/blogs.dir/2/files

    So for some reason, it's not finding the file name on the front-end. What could be causing this?

  3. This also works: flooringlifemagazine.com/files/room1.jpg

    So everything .htaccess wise is great.

    Can you link to a post that has this problem?

  4. coreymj78
    Member
    Posted 1 year ago #

    Ok, I even checked the GUID of the post Attachment and it is also pointing to the correct path:

    http://flooringlifemagazine.com/wp-content/blogs.dir/2/files/room1.jpg

    So why is it not showing up on the front-end and why is BP unable to load the images as well?

    Here is the post:

    http://flooringlifemagazine.com/flooring-your-life

    Now I am seeing an error show up on the page as well saying something about "expecting parameter 1 to be string" and refers to one of my theme files, which again, nothing changed with my theme either, I just backed up everything as it was and restored them on my new VPS.

  5. coreymj78
    Member
    Posted 1 year ago #

    Thanks for your help.

  6. coreymj78
    Member
    Posted 1 year ago #

    Here is the error message that appears where the broken image is:

    Warning: getimagesize() expects parameter 1 to be string, object given in /home/coreymj7/public_html/wp-content/themes/parallelus-mingle/framework/utilities/media-functions.php on line 152

    Warning: basename() expects parameter 1 to be string, object given in /home/coreymj7/public_html/wp-content/themes/parallelus-mingle/framework/utilities/media-functions.php on line 153

    Here is the function and parameter $new_img_paththat is having trouble on that post:

    $new_img_size = getimagesize( $new_img_path );
    $new_img = str_replace( basename( $image_src[0] ), basename( $new_img_path ), $image_src[0] );

    Here is the post where the error appears:

    http://flooringlifemagazine.com/flooring-your-life

    Basically this means that the function getimagesize and basename used for resizing images get stuck when trying to fetch the image path via $new_img_path.

    At least that is what I'm guessing. What could cause this?

  7. coreymj78
    Member
    Posted 1 year ago #

    Ok, I went into WHM and I am now turning on the GD Library and restarting Apache to see if that fixes the problem. It was turned off.

  8. So that worked?

  9. coreymj78
    Member
    Posted 1 year ago #

    Yep.

Topic Closed

This topic has been closed to new replies.

About this Topic