• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

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.
0
m2ew
Asked:
m2ew
  • 13
  • 7
3 Solutions
 
jeremyjared74Commented:
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.
0
 
m2ewAuthor Commented:
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.
0
 
jeremyjared74Commented:
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?


0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
m2ewAuthor Commented:
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.
0
 
jeremyjared74Commented:
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
0
 
m2ewAuthor Commented:
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
0
 
m2ewAuthor Commented:
After some further testing my image settings in the media (ie. Large, Medium & Thumbnail). Appear unclickable due the images not generating
0
 
jeremyjared74Commented:
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.
0
 
m2ewAuthor Commented:
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.
0
 
m2ewAuthor Commented:
Ok well so much for WP_debug, it is throwing a 500 error. Any ideas?
0
 
jeremyjared74Commented:
Try using the conditional debug option. This is what I use on my sites:

Open your wp-config.php and navigate to the part
define('WP_DEBUG', false);

Open in new window

.

You are going to delete that and place this code in it's place:
if ( isset($_GET['debug']) && $_GET['debug'] == '1' ) {
define('WP_DEBUG', true);
define('SCRIPT_DEBUG', true);
define('STYLE_DEBUG', true);
} elseif ( isset($_GET['debug']) && $_GET['debug'] == '2' ) {
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
} elseif ( isset($_GET['debug']) && $_GET['debug'] == '3' ) {
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
}

Open in new window


Now when you go to the site (back-end or front-end) wp_debug will be turned off.  You can access it by adding this to the tail of the URL:
?debug=1

so if your URL was:
http://localhost.com/

you would do this to turn on the debug function:
http://localhost.com/?debug=1

There are 3 levels of debug for this functions. I don't remember the order though. One debug
s all (I believe it's the number 1), the others are script and style debuggers. To access them exclusively you would just replace the 1 in ?debug=1 with a 2 or 3. I always use 1 for all options.

The only downside to this is it doesn't always work. For example, if you are in the theme-editor it might not work if you added that to the end of the URL after saving a theme file. You've seen the extremely long URL's those are the ones that won't work. What you need to do is remove the junk at the end that looks something like this:
http://wordpressexpression.com/jjared/wp-admin/theme-editor.php?file=%2Fthemes%2Fexpression_framework%2Fportfolio-twocol.php&theme=WP+Expression+Themeworks&dir=theme

In the example above you'd remove everything back to the ? after editor.php and then add the ?debug=1. Clear as mud isn't it.

This may or may not provide the info you need. Since your error is probably happening on load, it may requite error logging. I know how I enable it for my sites, but I'm not running on a windows server I'm on Linux (I suggest everyone use Linux if at all possible). Anyway you can try to enable the file logging by adding some code to your functions.php. I have file logging enabled on my current servers so I haven't tested this in about a year, but it did work at that time.

Here is the code:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

Open in new window


This will create a log file named:
debug.log

it will save all errors to that file. If it isn't created by an hour, you might need to upload a blank file and name it debug.log and upload it to your WordPress root folder.

Let me know if anything works.
0
 
m2ewAuthor Commented:
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.
0
 
m2ewAuthor Commented:
With the php install that is.
0
 
jeremyjared74Commented:
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.
0
 
m2ewAuthor Commented:
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).
0
 
m2ewAuthor Commented:
Here is a the only solution I can get to work so the thumnails are getting generated.
http://www.howyoudo.info/index.php/how-to-fix-windows-server-upload-file-inherit-permissions-error/
0
 
jeremyjared74Commented:
Strange that it worked before with an older server. Not much of an upgrade when you loose features eh?
0
 
m2ewAuthor Commented:
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.
0
 
m2ewAuthor Commented:
After some more research the best option (security wise) is to create a temp dir just for php (outside of IIS). That way its more secure as the general access is not allowed to touch the default windows temp folder / files
0
 
m2ewAuthor Commented:
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.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 13
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now