Debugging an HTTP ERROR 500 in 10 Seconds with Kinsta Logging

I recently decided to move my WordPress sites from HHVM over to PHP 7.1. HHVM is way faster than PHP 5.6, but with PHP 7 and now PHP 7.1 out, the speed difference is very minimal. And as of May 2017, WordPress has announced they are no longer supporting or testing with HHVM. So it is now time for everyone to adopt PHP 7.1. However, upon migrating one of my sites, I encountered an HTTP error 500 which took my site down. See how I quickly debugged this in under 10 seconds thanks to Kinsta’s logging tool.

HTTP ERROR 500

An HTTP ERROR 500 typically can occur for a number of different reasons. Basically, it means there is an internal error on the server. Many in WordPress also refer to this error as the white screen of death. In my personal experience, this is almost always caused by a plugin or theme.

HTTP error 500
HTTP error 500

Debugging the HTTP ERROR 500

Upon moving the site to PHP 7.1 I was instantly met with the HTTP ERROR 500. Thankfully Kinsta has a quick and easy logging tool in the dashboard which allowed me to quickly see what was going on. And of course, you can always enable logging yourself if you don’t have a host with it. If you see below, the free One Signal plugin which I utilized for push notifications was getting a PHP fatal error over and over again.

PHP message: PHP Fatal error: Cannot redeclare admin_notice_error() (previously declared in… /public/wp-content/plugins/onesignal-free-web-push-notifications/onesignal-admin.php

WordPress error log
WordPress error log

One of the quickest ways to get your site back online in these situations is to simply FTP to your WordPress site and rename the plugin to something else, such as plugin_old. This will disable the plugin.

Rename plugin _old
Rename plugin _old

After doing that my WordPress site was then working again. However, I was already running the latest version of the plugin and I knew this was supported with PHP 7.1 as I was using it on other sites. So that instantly told me it was a conflict with another existing plugin. So I quickly disabled all the plugins on the site, and enabled them one by one.

Deactivate all WordPress plugins
Deactivate all WordPress plugins

It turned out to be one of the plugins we had custom wrote for the site. It was a simple function that was now outdated. After updating that we were good to go again! In most cases, if you determine which plugin it is, you can reach out to the developer for assistance or for a path to let them know there is a conflict.

This was just a friendly reminder:

  • Why you should use a staging environment.
  • Don’t panic when you get a white screen of death. Usually, you can easily determine what is wrong with the process of elimination.
  • Error logs are your friend and can speed up troubleshooting!

Summary

As you can see, an HTTP ERROR 500 or white screen of death, can usually be quickly resolved. In some cases, it might be a more complex issue. But in most cases, it usually comes down to a plugin conflict or you simply need to update the plugin or theme to a newer version. Most things today should support PHP 7, and if they don’t, I would recommend looking for an alternative.

Have any similar issues? Would love to hear how you debug WordPress problems.

GET MORE STUFF LIKE THIS

Marketing, WordPress, Blogging Tips, SEO and Reviews, once a week.

Thank you for subscribing.

Something went wrong.

Leave a Comment

17 Shares
Tweet
Share
Share
Buffer