A Quick Way to Debug WordPress 500 Errors

I’ve built and uploaded three WordPress based websites this week, so at the moment I’m pretty ‘well-schooled’ in how to migrate from a local to live server.

I had a curious error with the third.

Somehow, it just wouldn’t display after uploading. Here’s my usual workflow:

  1. Upload Files to Server
  2. Export SQL Database
  3. Import SQL Database to New Location
  4. Update the wp-config.php file to include my new database credentials
  5. Log into the new SQL Database and adjust the home and site_url records in the wp-options table

This process has served me quite well, but not in this particular case.
Just to ensure I hadn’t missed a step, I wiped and completed them all a second time. Still getting a 500 error.

I had not set up permalinks yet, so there was no .htaccess file to contend with (a common cause), and I can ensure the settings described above were perfect.

I was stumped.

WP_DEBUG

In the wp-config.php file, I’ll found the WP_DEBUG setting set to false.
I set this to true and added a couple of values of my own:

When I next refreshed the page, it told me exactly where to look for my error.
My error was caused by a custom class I downloaded not being compatible with the live-server’s version of PHP. It was a simple fix, which I implemented quickly.
It’s error report was a lot more informative than simple ’500′

Took me a while to find this solution though. Time wasted!

Comments

comments

Powered by Facebook Comments