View Categories

How to Fix a 500 Internal Server Error

  • Aug 06, 2020
  • 0
  • by Alex Ali

As a site owner, the most frustrating issue is discovering that visitors can’t access your site. An unavailable site will usually display an error message depending on the problem. If you’re facing a 500 internal server error on your WordPress website, there are certain steps you can take to fix it.

In general, this error message hints at a problem with the website’s server. Considering that it may be caused by a couple of factors, troubleshooting a 500 internal server error can be tricky.

In this article, we’ll talk about the possible causes of a 500 internal server error and walk through how you can fix it. Let’s get started!

What Is 500 Internal Server Error (And Its Causes)

In short, if there’s an issue fulfilling a network request between your computer and the web host, you’ll see the 500 error message. However, there are numerous causes.

A 500 Internal Server Error.

Due to the lack of specific information, a simple generic 500 internal server message can be a hard nut to crack. Let’s take a look at some of the most common factors that could cause it:

  • Your themes and plugins. Mismatched compatibility between your plugins and themes can lead to the error, and some types of plugins are more prone. As such, it’s always a good thing to research your chosen theme or plugin before installing it.
  • Incorrect file permissions. Another cause of the 500 internal server error may be files with the wrong permissions set. PHP and CGI scripts are regular offenders here. You’ll know you have file permission issues if you see strange entries in the server logs.
  • Memory limits being reached. Most scripts and plugins on your site require a particular amount of memory to function. If this is maxed out, it will throw an error.
  • Issues with your .htaccess file. Given how this file is used, it may be interfering with the normal activities of your server. An error message is what you get in response.

We’ll discuss each of these in more detail later, when we show you how to diagnose and fix the 500 internal server error. In the meantime, let’s go over how to prepare for the job.

What You’ll Need to Fix the 500 Internal Server Error

Once you know the possible causes of the 500 internal server error, you should also get familiar with the tools you’ll need to fix it. There are essentially two tools you need to use to apply the fixes we’ll be talking about in the next section:

  • Access to the WordPress back end. The back end of your site should always be the first port of call whenever an error crops up. However, you may not have this access. This is where the second tool comes in handy.
  • A File Transfer Protocol (FTP) client. This is software that acts as a bridge between your local computer and web server. By default, your WordPress back end also does the same. However, a secure FTP client can also get the job done, especially if an error has cut access to your dashboard.

In our opinion, even with access to the WordPress dashboard, FTP may be your default option – especially if your skills are sharp. However, with both of these elements ticked off, you can begin to dig into your site.

How to Fix the 500 Internal Server Error (In 5 Steps)

Having talked about some of the common causes of the 500 internal server error, let’s quickly take a look at righting the ship, starting with WordPress’ extended features.

1. Check Your Themes and Plugins for Issues

This is arguably the first step to take, because it’s the most common issue and is relatively simple to do.

If you have access to the back end, simply deactivate each plugin in turn, and refresh your site to check for the error. However, if you can’t access the back end, you’ll want to grab your FTP credentials from your web hosting dashboard, and fire up FileZilla.

Once you’re in, look for your site’s wp-content folder – usually it’ll be in the www or public_html directories, or in a folder named after your site. Here, find the plugins folder, and rename it:

Renaming the plugins directory via FTP.

At this point, all of your site’s plugins will be deactivated. You should then be able to access your WordPress back end, where you can reactivate each plugin and theme individually, refreshing your site each time.

Once you’ve found the offending plugin or theme, you’ll want to delete it and contact the developer for a fix. If the theme or plugin was vital to your site, you’ll also want to look for a replacement.

2. Check and Reset Your File Permissions

As we mentioned, file and folder permissions are sometimes a cause of the 500 internal server error.

You’ll want to use FTP for this task, and when you begin to look at file permissions, you’ll usually see a designated number next to each file or folder. While the exact meaning behind each of them is beyond the scope of this article, most should be set to 0755 or 0644:

Viewing file permissions.

To change them, right click a file or folder in FileZilla, and choose the File Permissions… option. This will pop up a window that lets you change the file permissions, and updates the number at the same time:

Editing file permissions via FTP.

To set the permissions we mentioned earlier you’ll want to change the following to a ‘full tick’:

  • 0644: Set the Owner to Read and Write, and both the Group and Public permissions to Read.
  • 0755: Set the Owner to Read, Write, and Execute, and both the Group and Public permissions to Read and Execute.

At this point, check your site again, and see if the error persists. If not, you know file permissions were the root issue. If you’re unsure which permission level to give, start with 0644 and try 0755 if you get no joy. Remember, you’ll want to reset the permissions that had no effect on the 500 internal server error, to keep your site as safe as possible.

3. Increase the PHP Memory Limit

At this point, increasing your memory should be straightforward. It will just be a case of finding your wp-config.php file using FTP, and editing it.

This file can be found within your root directory, and clicking the View/Edit option will open it in your text editor of choice.

From here, paste define( ‘WP_MEMORY_LIMIT’, ’64M’ ); just after the opening <?php tag, save your changes, and recheck your site.

Increasing the WordPress PHP memory limit.

If the error has disappeared, we’d recommend contacting your web host to ask whether a memory increase is possible. Alternatively, they may be able to help you find a more permanent solution.

4. Create a New .htaccess File

Creating a new .htaccess file is similar to renaming a plugins folder. Simply access your site through FTP, find the .htaccess file in your root folder, and rename it:

Replacing .htaccess.

Check your site again, and if the error disappears, create a new .htaccess file by heading to the Settings > Permalinks page within your WordPress dashboard, and clicking Save Changes. If not, you’ll want to look at the final method.

5. Talk to Your Host

In a nutshell, if none of the above steps work, you should contact your host. The right web host will be prompt and helpful in solving the 500 internal server error.

We also recommend asking them what the cause was, and whether this is something you can fix yourself in future. After all, you now know how to manage your site with FTP, so if another error arises, you’ll be well-equipped to deal with it.

What Is Internal Server Error Conclusion

The 500 internal server error can be a frustrating problem. Because there isn’t always a clear cause or solution, you’ll have to troubleshoot the issue.

However, if this error appears after you make changes to your plugins or themes, this is the first place you should look. Even so, your web host will often have a solution too, so if your efforts have gone unrewarded, your best move is to contact support.

 

Image Credits: panumas nikhomkhai.

The A2 Posting