NR Hosting Ltd

500 Internal Server error – How to fix it

500 Internal Server error – How to fix it

The 500 Internal Server Error is a very general HTTP status code that means something has gone wrong on the website’s server, but the server could not be more specific on what the exact problem is.

Websites phrase 500 errors in many ways but they’re all basically saying the same thing: there’s a general server issue going on right now.

Most of the time there isn’t anything you can do but contact the website directly and then wait on them to fix it.

On the off chance there is a problem on your end, try clearing the cache and deleting any cookies from the site with the error.

Different views of the 500 Server Error

The error message might be seen in any number of ways because each website is allowed to customize the message.

Here are several common ways that you might see the HTTP 500 error:

500 Internal Server Error

HTTP 500 – Internal Server Error

Temporary Error (500)

Internal Server Error

HTTP 500 Internal Error

500 Error

HTTP Error 500

Since a 500 Internal Server Error is generated by the website you’re visiting, you could see one in any browser in any operating system, even on your smartphone.

Most of the time, it displays inside the browser window, just as web pages do.

Cause of 500 Server error

  •     Browser Cache.
  •     Incorrect database login credentials.
  •     Corrupted database.
  •     Corrupted files in your WordPress installation.
  •     Issues with your database server.
  •     Corrupted WordPress core files.
  •     Corrupted .htaccess file and PHP memory limit.
  •     Issues with third-party plugins and themes.
  •     PHP timing out or fatal PHP errors with third-party plugins.
  •     Wrong file and folder permissions.
  •     Exhausted PHP memory limit on your server
  •     Corrupted or broken .htaccess file.
  •     Errors in CGI and Perl script.

Like we mentioned above, Internal Server Error messages indicate that something, in general, is wrong.

Most of the time, “wrong” means an issue with the page or site’s programming, but there’s certainly a chance that the problem is on your end.

To check if the problem is from your end do the following:

Reload the web page. You can do that by selecting the refresh/reload button, pressing F5 or Ctrl+R, or trying the URL again from the address bar.

Even if the 500 Internal Server Error is a problem on the web server, the issue might just be temporary. Trying the page again will often be successful.

If the message appears during the checkout process at an online merchant, be aware that duplicate attempts to checkout may end up creating multiple orders— and multiple charges! Most merchants have automatic protections from these kinds of actions, but it’s still something to keep in mind.

Clear your browser’s cache. If there’s a problem with the cached version of the page you’re viewing, it could be causing HTTP 500 issues.

Internal Server Errors are not often caused by caching issues, but we have, on occasion, seen the error go away after clearing the cache. It’s such an easy and harmless thing to try, so don’t skip it.

Delete your browser’s cookies. Some 500 Internal Server Error issues can be corrected by deleting the cookies associated with the site you’re getting the error on.

After removing the cookie(s), restart the browser and try again.

How to Fix the 500 Internal Server Error

Deactivate all the Plugins

One or more plugins can cause the internal server error. In such a scenario, you can try deactivating all plugins and see if the error goes away.

In case you can access the admin area of your WordPress site, you can manually deactivate each plugin.

If you are not able to access the WordPress admin area, then you can connect to your site using an FTP client.

Once you are connected, go to the wp-content folder. In that folder, there is a folder named “Plugins”. To deactivate the plugins on your site, simply rename the folder to something else. For example, you can rename the folder as “Plugins_old”.

Once your plugins are deactivated, you can see if the site is working without any error. If the error is resolved then you can be sure that one of the plugins was the cause of the error. You can narrow down the culprit by activating each plugin one-by-one and checking the error at the same time.

Change Theme

If deactivating the plugins does not resolve the error then the next step is switching your theme. Some theme functions may cause problems and the error can occur. The best way to be sure is to revert to a default WP theme like Twenty Ninteen and see if the error persists.

If you are not able to access the WordPress admin area, then you can switch to the default theme by simply renaming your current theme file.

Check for Corrupt htaccess file

Sometimes a corrupt htaccess file may throw an error like 500 internal server error. How to resolve the error in such a case?

Follow these steps:

  •     Connect to your site using FTP and locate the .htaccess file
  •     Rename the file. For example, .htaccess_old
  •     Check your site and see if the problem is solved

If yes, then you just need to do one last thing: Go to Settings>>Permalinks in the WordPress    Dashboard and “Save settings” without making any changes. This will create a new .htaccess file with proper rewrite rules that will work well with your site.

You can move on to other options if this error does not solve your problem.

Increase PHP memory limit

Sometimes the insufficient memory allocated to PHP can be the cause of the trouble. You can try increasing the PHP memory limit.

There are three ways:

A) PHP.ini

If you have access to your PHP.ini file then edit the file and add the following line of code.

memory_limit = 256M ;

You may just have to change the value from 64 to 256.

B) htaccess

Simply add the following line to your .htaccess file:

php_value memory_limit 256M

C) wp-config.php

Add the following line to the top of your wp-config.php file

define(‘WP_MEMORY_LIMIT’, ‘256M’);

Note that your web host may have restricted the allocated memory in which case the above codes will not work. Check with your web host about the memory limits.

Reupload wp-admin and wp-includes folder

Sometimes there is some problem with the wp-admin and wp-includes folder of the WordPress installation.

You can resolve this issue by downloading a fresh WordPress installation file and upload the “wp-admin” and “wp-includes” folders to your site using FTP.

You will be asked if you want to overwrite the files. Select “Overwrite”. Also, check the box that says “Always use this action” and click OK.

The FTP will upload the WordPress files. If the problem was due to corrupt WordPress files, then this step will resolve the error.

Change File Permissions

The only remaining fix for you to try is to change upload folder permissions.

How to do that?

  • First, connect to your FTP site using an FTP client.
  • Go to the root directory of your WordPress site.
  • Select all the folders in the root directory. Right click and select “File Permissions”.

File Permission

File Permissions dialog box will open. Enter 755 in the “Numeric Value” field.

public_html File Permission

Tick the box that says “Recurse into subdirectories”.

Select the  “Apply to directories only” option. Click on “OK”.

By now, the error should get solved. If not, you need not be disheartened. You have explored all the options. It is up to your web host to do some work now. We hope this exhaustive article gave you comprehensive ways to tackle the 500 internal server error. I hope one of these fixes works for you. Did you find another fix? Do share in the comments.

Leave a Reply

Your email address will not be published. Required fields are marked *