Link to home
Start Free TrialLog in
Avatar of Mike Tew
Mike TewFlag for Canada

asked on

Wordpress Add Image Size Error in IIS

I recently have moved a wordpress install to a new setup. I used the existing database as its within the existing network.

I have a add_image_size added to my functions. This worked on the previous server. My images are uploading fine, however none of my thumbnail generation isn't working. This leads me to believe that there might be a missing php component required. ie. GD Library ???

Also for some reason, when I reupload the same image in the wordpress admin, the file name isn't getting incremented / uploaded again. It just reloads the same file.
Avatar of jeremyjared74
jeremyjared74
Flag of United States of America image

If you're not sure what GD packet your host has, try the phpinfo.php trick to get all info about your php package.

Open a text editor and paste this into it:
<?php phpinfo(); ?>

Open in new window


Save the file as phpinfo.php

Upload the file to the root of the WordPress installation, usually htdocs, or public_html.

Open your web browser and type your URL.phpinfo.php. You should get a page that shows all your info. You can tap CTRL+F to search for GD and it should bring you directly to the part you want to see.

NOTE:
Make sure to remove the file as soon as you're finished viewing it.
Avatar of Mike Tew

ASKER

I did try the phpinfo route, and it was throwing a 500 error. Not sure why, but I did check with server support and GD Library is installed.

My next thought is that the temp directory doesn't have the proper permissions. When I reupload a file in wordpress it normally increments the name if the file exists. When I upload now, it doesn't do anything if the file is present; it just reloads the existing file.
When you say it increments a new image with an existing name do you mean it add (1), (2), etc... to the end of the file name? If that's what you mean, are you sure it's not adding the value to the end of the ifle name? The name or "Title" you see in the image upload won't be different, but if you view the URL for the image in the media upload box it should show the number relevant to amount exists on the server (for that months folder, I believe but I'm not 100% positive that an image with the same name might be allowed if it falls in a different month).

As far as the permissions go my current permissions are set as so:
All folders leading up to and including the uploads/images/year/month/ are set to:
755 or the text value if you don't have the numerical permissions are:
Owner Permissions:
x Read
x Write
x Execute

Group Permissions:
x Read
x Execute

Public Permissions:
x Read
x Execute


All image files inside the folder have the following permissions:
644

or the text value:

Owner Permissions:
x Read
x Write
x Execute

Group Permissions:
x Read
x Write

Public Permissions:

x Read

If you can check those at least you can rule that out as a possibility.

I should have stared with this question, but I'll ask now. Have you tried disabling all your plug-ins to rule out a possible conflict?


I updated the owner permissions and yes  atleast the filename is incrementing / not being overwritten. I'm not getting the (1) (2) etc that is usually posted in the title.

Still though, the add_image_size that I set in functions.php is not generating a thumbnail.
How did you implement the custom style? Just for a quick guide on how I do it (which I've used several times so if it doesn't work for you then it's probably server related (you might also try switching themes and adding the custom thumbnail size to it to rule out your current theme being the issue).

Here's my way of adding custom image sizes:

Code for the functions.php file:
add_image_size('portfolio_wide', 680, 280, true);

Open in new window


The last Parameter "true" will crop the image to the exact dimension set (if you have existing post thumbnails you might need to use the regenerate thumbnails plug-in).

The next step is adding it to the theme files that will display the thumbs (index.php, portfolio.php, archives.php or whatever your using).

I usually place this just after the_title();

<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to 
  <?php the_title(); ?>"><?php the_post_thumbnail('portfolio_wide'); ?></a>

Open in new window


Now you just need to go to the post edit screen and click on Add Featured Image and save/view the post.

I assume your theme already has the function to evoke the post thumbnails, but just in case here is the code that needs to be present for it to work:
add_theme_support( 'post-thumbnails' );

Open in new window


Sorry if I'm telling you things you already know. EE gets users of all experience levels so I like to cover the basics.

Regards,
JeremyJared74
Yes, I have that enabled. I'm actually using the advanced custom fields plugin to set the image.
I even tried to using the standard upload / insert on a test post and still no thumbnail generation.

I tried even tired applying the permission in iis for the public (Everyone) to have read, write privileges on the folder. When I opted to do so I got a security error saying that it couldn't apply to the images in the directory. I got an alert window for each image, and clicked continue and retried it again and still no thumbnail
After some further testing my image settings in the media (ie. Large, Medium & Thumbnail). Appear unclickable due the images not generating
Have you tried re-installing WordPress? Sometimes during upgrade/installation some files are corrupted. Maybe a clean install will help?

When you moved the site to the new server did you have any issues? What were your steps (general steps), I don't need every detail but it might help me or one of the other experts diagnose your problem.

Did you use a plug-in to export/impost the Database, did you use the WordPress export etc...

I'm not sure what else the issue could be. You say that the thumbnails won't generate, but you haven't mentioned if you're able to upload other media successfully. Can you load any images, or other attachments?

I'm not sure if it will help or not, but maybe try turning wp_debug on and see if it gives any error messages, or check your FTP to see if it has an error log. If you find one or you get WP_debug on and have more info post it. I'm not sure what else to do w/o more info.
I basically moved it over carbon copy & removed any references to the old server's directory. Since I was trying to make is a seemless transition, I just had the domain point to the new web server and it once it propagated the DNS. The previous server was IIS5 / windows 2000. The new server is IIS7 / windows 2008. The database is also hosted on the same new server, and hasn't moved since day 1.

One issue I did run into was that the Everyone user group (public) wasn't automatically appearing in the IIS folder properties. I had to run a search and add them into permissions. However, I think this is just a default of IIS7.

GD Library wasn't installed until after the move. The only other thing that I did in php was change the upload size from 2MB to 8MB.

I'm able to upload images / attachments just fine, it just the alternate sizes that aren't generating.

In the meantime, I'll try the WP_debug option.
Ok well so much for WP_debug, it is throwing a 500 error. Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of jeremyjared74
jeremyjared74
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok, only debug = 3 worked. Everything else went to a 500 error.
The log file shows 1 depreciated message and a plugin error for a different plugin (not advanced custom fields).

In any event I disabled the plugin, but no change.

It still don't get why phpinfo is throwing a 500. All I can think is that something in it must be broken and or with GD library.
With the php install that is.
It's probably a security setting. I've only set up 2 sites on an IIS server. Maybe they wouldn't be such a pain if had more experience. The experiences I had were similar to yours. It seems everyone I know that's had IIS hosted sites have similar issues. It usually turns out to be a security or permissions issue. The rest of the time it ends up being old server, old PHP, or not compliant Graphics Library.

You should consider disabling plugins, and temporarily switching to TwentyEleven theme to rule out plugin or theme issues. It would really suck to spend this much time on an issue to find out it was a plug-in issue.
I recreated a test / fresh wordpress install with the permissions & no plugins.
Uploads produced the same result (ie. no alternate image sizes; thumbnail, medium, large).
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Strange that it worked before with an older server. Not much of an upgrade when you loose features eh?
Yes. The configuration steps do seem weird. Nothing like going 2 steps forward and 1 step back.
The one bonus with the upgrade is the definite performance boost with a newer server running windows server 2008 from 2000.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ultimately, the debugging helped deduce any error with wordpress with the log file. However, the resulting fix was was due to windows permission settings block the file for use with the GD library.