Last week we were innocently editing a client’s website, when we noticed that the dashboard was painfully slow to load. And then we got the dreaded 500 server error. And not just once, but a few times. No doubt you’ve experienced this before: you try to go to a particular website, and nothing loads except a plain text page that says “500 Internal Server Error,” or “HTTP 500 – Internal Server Error,” or “Temporary Error (500),” or some variation thereof. This is a server-side error, which means that your computer or Internet connection is not the culprit.

Instead, there’s likely a problem with the website’s programming. As a user, you can try a few things to resolve the error:

  1. Hard-refresh the page. On a PC, press ALT and F5. On a Mac, hold down ⌘ Cmd and ⇧ Shift key and then press R. (Pro tip: you probably don’t want to do this if you’re in the middle of the checkout process, if you’re purchasing something. Doing so could create duplicate orders.)
  2. Clear your browser cache.
  3. Clear your cookies.

After a couple of attempts to reload the site, we didn’t bother with any further steps when trying to diagnose the 500 server error. We knew right away that it was most likely the server resources struggling under the weight of four fairly complex websites that get a lot of visitors. Still, we followed a rubric. All four sites were running WordPress, so we knew there were a few likely culprits.

We logged into the Cpanel and noted that our I/O Usage and Memory Usage were maxed out. I/O is the speed at which your website can retrieve and store data from the hard disk of your server. Physical memory, or RAM, determines how much data is stored in memory for quick access by your website. The more RAM you have, the faster your site performance will be for your visitors. Similarly, increasing I/O will result in less of a slowdown when your site is busy and your server is trying to process data.

At this point, we might have checked to make sure that the WordPress core and all plugins were updated. Sometimes, outdated code can slow a website down. But in this case, we already knew everything was up to date. We might also have checked to see if there were any unnecessary or bloated plugins that might be gumming up the works. We’re looking at you, Jetpack. If we were running a ton of plugins, we might have tried disabling them one by one and seeing if that fixed the problem. But again—we knew that these website plugins were as lean and mean as possible.

So, in the Cpanel, we selected “PHP Processes,” and clicked the “Kill Processes” button. Then we opened one of the websites hosted on this server, clicked around, and saw the Memory Usage and I/O Usage quickly shoot up again. We killed the processes again, opened another of the websites hosted on this same server, clicked around a bit, and the same thing happened. It was obvious: the websites had outgrown the server resources. In this case, it was an easy fix. For an extra $5 per month, we could double the memory and I/O. At some point, it may be necessary to move the websites to a Virtual Private Server, or VPS. That decision is a way off in this case.

If it weren’t so obvious, here are the top problems that might have been causing the 500 server error.

A Permissions Error

In many cases, a 500 Internal Server Error stems from an incorrect permission set on one or more files or folders. In most of those cases, an incorrect permission on a PHP and CGI script is to blame.

A PHP Timeout

If a script on the website connects to external resources and those resources time out, a 500 server error can occur. Timeout rules, or better error handling in your script, should help if this is the cause of the 500 server error. With WordPress, you can try increasing your PHP memory limits to see if this fixes the problem.

Corruption or Misconfiguration of the .htaccess File

If the .htaccess file is improperly configured or has become corrupted, it may cause of 500 Internal Server Error. With WordPress, you can rename your old .htaccess file by logging into the website via FTP. If you’re able to load the website after doing so, the error is fixed, and you just need to regenerate the .htaccess file by going to Settings, then Permalinks, then clicking the “Save” button.

Experiencing 500 server errors for your website? We can help! Give us a call or contact us anytime.

Published On: March 3rd, 2017 / Categories: Blog / Tags: , /

Subscribe to Receive the Latest News from I.T. Roadmap