Categories
General

WordPress + IIS = Suck

I’d heard it’s difficult to get WordPress working well on an IIS host but had never experienced it myself. In my case the install appeared to be working, but then looked like it’d failed on step 2. Browsing to the site, the text was all there, but clearly the style sheet hadn’t been loaded. The internal links were also all messed up, with “?step=2” thrown in instead of the folder name where I’d installed the blog. A bunch of browsing of the WordPress forums revealed widespread IIS problems and a few proposed solutions. I tried a couple, involving editing wp-settings.php, but without effect.

I thought maybe the fixes I found were specific IIS server setups, but not necessarily mine. So, I looked at my sorry IIS server’s phpinfo() output, which revealed some obvious problems with my wp-settings.php. Apparently IIS/PHP doesn’t set some of the variables that WordPress wants, so WordPress attempts to create those variables, based on variables it supposes IIS/PHP ought to set. But my server’s variables weren’t named quite right for WordPress to suss out the variables it wanted. I changed the variable names in wp-settings.php to match my phpinfo() output and it worked.

I did end up having to delete the database tables for each install attempt. I don’t know how many people run into install issues, but if there are a lot maybe it’d make sense for WordPress to do some sort of post-install sanity check. Even better if that sanity check involved a form where one could hardcode in those problematic server variables.

Update: I should have seen this coming based on what I saw browsing the forums earlier, but the admin emails from WordPress wouldn’t work out of the box. I’d guess that the dear IIS host I’m working with has had issues with spam so they don’t allow PHP to send unauthorized mail. Fortunately, there’s a plugin that lets you manually set WordPress to use an arbitrary SMTP server. There are actually a couple, but WP Mail SMTP is working for me.

Another update: I just installed another instance of WP on the same IIS host and had a little different experience. First I tried installing without changing anything in wp-settings.php. The install failed when I went to the install page through index.php, but I thought I’d try going directly to wp-admin/install.php before editing anything. For some reason that worked just fine, maybe because then the relative paths worked?

Avatar photo

By isaac

I like cats. he/him