How I beat WordPress WSOD and the blues

Jonnie Grieve Digital Media
4 min readApr 3, 2018

--

It’s around a week since I first posted about my problem with the dreaded White Screen of Death (WSOD) in WordPress.

A problem that conspired to completely drain my confidence in my abilities as a designer/developer. I expect everyone experiences these peaks and troughs in their confidence but for me it wasn’t just low. It was cripplignly down. In fact I would go as far as to say that it depressed me. I don’t say that lightly.

I’ve had the Easter weekend to recharge my batteries and today it was time to get back to the grind.

The problem itself hasn’t gone away (as I write) this but I’m feeling ready for a new week. I just wish I could have nailed down the exact problem causing this issue.

As I started today, I’d left one page open on the top navigation having set 2 navigation areas for the theme. And clicking that brought nothing but blank white page. This is on the local server version of the site.

I had a fresh look at the error log and it said this

“server certificate does not include an id that matches the server name”

With a fresh head on my shoulders I could only determine that I’d somehow copied across a server configuration on a local server that simply wasn’t designed to work with the kind of environment I was working on. So I didn’t waste too much more time trying to work out the answer here. I had to assume that was the right answer here and tried one more trick.

I noticed my wp-config file was missing 2 constants.

define(‘WP_HOME’,’http://localhost/almack');
define(‘WP_SITEURL’,’http://localhost/almack');

What these do are, in property terms give the WordPress site and address. Without these terms, the server basically assumes the domain it is living on is the address unless you explicitly define it. So I tried this, hoping this would help the permalinks define the pages in the site.

It didn’t work.

But this time I wasn’t too disheartened. And cracked on what my main plan for the morning.

Delete and Restart.

I had another crack at deleting the WordPress installations on both my local server and web server and started again. I tried this approach last week, solving nothing but I thought it was as good a place as any to start my debugging.

So having deleted all my installations and concentrated on developing my local install I went ahead and reinstall. This was a painstaking process but it was well worth it. With deep breaths I rebuilt the theme, with an empty style.css file. I also created a page.php template to help test that the pages were being correctly loaded via the navigation menu.

It came back as object not found. This was okay. In fact this was brilliant! An error message for me to go on. The next thing to do was to simply add a .htaccess file from a working WordPress site I’d previously created

Ta -da!

Success and proof of it

For now. For *now*, I appear to have resolved the issue. I have verified that WordPress has correctly picked up the page.php template by clicking on the *home* link. I left some identifying code in the template to mark out the individual templates.

At this point, I now have everything now set up minus the styles. I thought that may have need to hardcode some of the images paths again but I’d deal with that in turn.

But the link works. No white screen of death. No server error messages.

I stress “for now” because I’m still not across why the error showed up in the first place and if the error will ever return. I’d not known the WSOD to be so persistent in my experience as a WordPress developer.

It took plenty of retracing of my steps to get to this point. I mentioned the .htaccess earlier. I had noticed when I did the fresh reinstall of WordPress it did not include a .htaccess file. I did expect one but this is where I maybe went wrong. I probably copied over a corrupted .htaccess file in my original attempts to create this website… one that I’ve only now been able to override.

I did the same tactic again and copied over a .htaccess file from a working WordPress site I previously created and changed the file paths within the code.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /almack/
RewriteRule ^index\.php$ — [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /almack/index.php [L]
</IfModule>

# END WordPress
```

Presto.

You will have noticed that the screenshot showed the site was completely devoid of any styles. I’ll now add these to the style.css file.

I say again I have no defintive knowledge of how I ended up with the WSOD. But I’m as sure as I can be that I’d somehow introduced a misconfigured or corrupt file when I attemped to build the site before.

I have since been trying to catch up with the time I have lost. There’s still a lot of work to be done and I’m still trying to build up my confidence. But what I hope people take away from this mini series is that there is always a way, always and answer and if you can’t find a way round, perhaps the answer is to simply take a step back and even retrace your steps. Sometimes all you need is a fresh perspective.

--

--