Support » Networking WordPress » Cannot Upload Featured Image In WP

  • Resolved coreymj78


    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:
    File Upload URL:
    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.

Viewing 8 replies - 1 through 8 (of 8 total)
  • 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:

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

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

    Moderator Ipstenu (Mika Epstein)


    πŸ³οΈβ€πŸŒˆ Halfelf Rogue & Plugin Review Team Rep

    This also works:

    So everything .htaccess wise is great.

    Can you link to a post that has this problem?

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

    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:

    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.

    Thanks for your help.

    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:

    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?

    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.

    Moderator Ipstenu (Mika Epstein)


    πŸ³οΈβ€πŸŒˆ Halfelf Rogue & Plugin Review Team Rep

    So that worked?


Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Cannot Upload Featured Image In WP’ is closed to new replies.