How to Fix The 500 Internal Server Error on WordPress?

WordPress is very stable; there is no doubt about that. It’s an open-source CMS that continues to be the prime choice for webmasters and entrepreneurs all over the world. 

But sometimes, WordPress gives out errors that make users look at their screen in disbelief and confusion. They’re a dime a dozen but are incredibly frustrating when they occur.

The 500 Internal Server error is a primary example of such errors. 

It’s a generic error and can happen to any WordPress website. If you’ve encountered such a mistake and are confused about what to do, keep on reading. 

In this article, we’ll show you several ways in which you can troubleshoot and solve the 500 internal server error on WordPress. 

The 500 Internal Server Error

This error is one of the most common WordPress Errors out there. The causes of this error usually revolve around poorly coded themes and plugins, exhausted PHP memory limits, and other issues we’ll be discussing in this article. 

To illustrate, this is what the error looks like: 

This error usually occurs when you’re trying to access the WordPress dashboard. You can access the front-end of the website, but not the admin panel. 

For the regular webmaster, the language displayed in the error doesn’t do justice as well. Don’t worry though, cause in a while you’ll see how you can fix this error. 

Troubleshooting The 500 Internal Server Error in WordPress

Here are some of the ways you can circumvent the 500 internal server error. 

Making Sure Your .htaccess File Isn’t Corrupt

When faced with this error, you should ideally look at your .htaccess file. Corruption within that file can cause the error within the website. 

You can access the .htaccess file using the FTP (File Transfer Protocol) that’s present within the File Manager. You can access it through the cPanel.

Once you’ve logged into your cPanel and in extension, have access to your FTP, you can start looking for the .htaccess file. Inside the public_html file, you can gain access to the .htaccess file. 

Editing Your .htaccess File

When you’ve found the file, all you have to do is double click on it to rename it. For example, you can change the filename to .htaccessone or .htaccess.old

Now, try to log in to the wp-admin and see if the error persists. Make sure you’ve cleaned up your browser’s cache and history before you check. 

If you successfully log-in, then congratulations. All you have to do now is from your permalink’s dashboard, click on Settings > Permalinks and hit Save

If the error is still there, it’s time you moved on to the next step of the tutorial. 

Increasing the PHP Memory Limit

Another culprit that causes this error is a lack of PHP memory limits. All you have to know about it is that the limit is just too small. 

To solve this issue, you need to create a Notepad file and add the following code into it: 

memory=64MB 

Once you’ve done that, save the file as php.ini. Now, upload the file to your wp-admin folder through the FTP.

Log-in to your wp-admin again to see if the error persists. If it doesn’t, hold your horses, we still need to find out what’s causing the error. 

This error is sort of unique in that it can occur due to a lot of issues—errors within the theme code, poorly-coded plugin, among other factors. 

Ideally, you should contact your hosting service provider if the PHP memory issue occurs. They can give you a complete log of your server and hopefully fix the problem for you.

If increasing the PHP error limit doesn’t fix the error, it’s time we move on to troubleshooting issues with plugins and themes. 

Deactivating All Plugins

If you’ve tried and failed to fix the error in the previous steps, don’t lose hope. There are still two ways you can fix this issue. 

Plugin conflicts are another reason why the “500 internal server” on WordPress can occur. The conflict can come with a single plugin or multiple plugins. There is no exact method to find out. 

Fortunately, you can find out which plugin is causing the issue by first deactivating, and then activating all the plugins installed on your website. 

Here’s how you can do that. 

Access your File Manager through your FTP and from there, visit the /wp-content/ folder. Inside, you will find a folder called Plugins. Renaming the folder to Plugins1 or Plugins_old. deactivates all the plugins present on your WordPress site. 

Try to log-in to wp-admin again and see if you can access it. If you can, let’s reactivate your plugins one by one. 

Go back to the FTP and name the folder you renamed before back to “Plugins again”. Now, go back to the WordPress dashboard and visit Plugins. 

The process of reactivating your plugin should go something like this. 

Activate one plugin > Log out and then log-in > Activate another plugin > Log out and then log-iIt n… 

If you activate a plugin and see the error on log-in, follow the renaming procedure mentioned above. Perform the flow again, only this time, delete the plugin that’s causing the problem. 

Now, you can encounter this problem with another plugin. In that case, keep up the same procedure. 

Tip: Once you’ve deleted the plugin, report the issue to the developers. It reduces the chances of other developers facing similar problems with the plugin. 

Re-uploading the wordpress core

If all of what we’ve mentioned above failed to fix the issue, it’s time we perform a “super-fix”. It’s nothing fancy. All we’re doing is reinstalling the wp-admin and wp-includes directories with a fresh WordPress installation. 

Note that in this context, the word reinstall doesn’t mean reinstalling WordPress itself. It may fix the error, and even if it doesn’t, you’re not going to lose any data. 

Install the Latest WordPress

Visit WordPress.org and download the latest version of WordPress. On your PC, extract the zip file and open up the WordPress folder. 

Open up your FTP and from there, locate the root directory which contains the wp-admin, wp-content, and wp-includes section. 

Uploading Fresh WordPress Files

There are two ways in which you can upload your fresh wp-admin and wp-includes WordPress files: 

  1. Dragging the files from the WordPress folder and dropping it into the FTP directory.
  2. Locating the folders, right-clicking on them and hitting Upload.

When you try to upload the FTP will ask whether you want to overwrite the files. Click Overwrite and Apply to the current queue only, and click OK

Contact Support

You’ve done everything, but the error doesn’t go away. Now what? At this point, we’d recommend you consult with your hosting provider. Having expert technical support in this matter can prove more beneficial since it can provide you with a detailed solution. 

Conclusion

It’s frustrating to see these errors on your WordPress site; we get it. The worst part is that we don’t know what caused the issue to happen, which adds insult to injury.

In this article, we’ve managed to provide you with all sorts of solutions to the 500 internal server error. Hopefully, you will fix this error once you’re done with it.

 

Author Bio:

Jibran Ahmed Sheikh is a WordPress Expert at B2BWoo. A Tech Fanatic by day and a reader by night, Jibran enjoys exploring the ever-changing world of Technology, Development, and eCommerce.

Tags: WordPress
Nick Loggie:
Related Post