Hostwinds Tutorials

Search results for:


Table of Contents


The Problem: 500 Internal Server Error Help
Internal Server Error
500 Internal Server Error Causes
How do I Fix a 500 Internal Server Error?
Problems with the .htaccess File
Problems with file or directory permissions
Problems with WordPress themes and plugins
Problems with your PHP code
Other Common Error Codes Beginning with Five (5)
501 not implemented
502 Bad Gateway
504 Gateway Time-out
505 HTTP Version Not Supported
506, 507, 508, 510, 511 Errors

500 Internal Server Errors

Tags: http errors 

The Problem: 500 Internal Server Error Help
Internal Server Error
500 Internal Server Error Causes
How do I Fix a 500 Internal Server Error?
Problems with the .htaccess File
Problems with file or directory permissions
Problems with WordPress themes and plugins
Problems with your PHP code
Other Common Error Codes Beginning with Five (5)
501 not implemented
502 Bad Gateway
504 Gateway Time-out
505 HTTP Version Not Supported
506, 507, 508, 510, 511 Errors

The Problem: 500 Internal Server Error Help

This error usually will look something like this:

Internal Server Error

What you may see: "The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@example.com, and inform them of the time the error occurred. Anything you might have done may have caused the error. More information about this error may be available in the server error log."

500 Internal Server Error Causes

If you see a 500 Internal Server Error, the server couldn't fulfill a request that appeared to be valid. Any error code that starts with the number five (5) means the server knows it's come across a problem and cannot do what's requested.

A general 500 Internal Server Error is probably caused by a simple mistake in the configuration somewhere on your site or a script that you're using. It doesn't tell you precisely what the issue is, as it's a general error. (We'll briefly explain other specific errors that start with five (5) at the bottom of this page)

Causes may include, but aren't limited to:

  • Bad lines in the php.ini file
  • Bad lines in the .htaccess file
  • Invalid permissions
  • Invalid script requests
  • Invalid ownership
  • Misconfiguration in the webserver configuration.

To find the exact cause, you should look at the error logs found in cPanel. If you need help, submit a ticket, and one of our techs will be happy to help you figure it out.

How do I Fix a 500 Internal Server Error?

There may be several possible causes to investigate to fix a 500 Internal Server Error.

First, make sure the .htaccess file is correct and that the folders and files on your site have the correct permissions. Be sure to check for any problems with themes and plugins, and check PHP code for errors.

The solution will depend on what initially caused the error. And once you've identified the cause, you can try to fix it.

Below we have listed some of the more common causes of the error and how to fix them.

Problems with the .htaccess File

Probably the most common cause of a 500 error, but If you aren't sure, follow these steps to determine if it's the cause (if you couldn't find the reason in the error logs):

  • Go to the File Manager in your cPanel
  • Set your File Manager to show hidden files
  • Rename your .htaccess file to something .htaccess.bak
  • See if the problem persists.

If the error is gone, then there is a problem with your .htaccess file. Change it back to the original name and start snipping out pieces of the code in the .htaccess file to identify the problem.

To do this quickly and safely, put a number sign (#) without parenthesis at the start of one line to "comment out" that line, so it's not "read" when your site is loaded.

Do one line, then check to see if the error persists. If it does, add it to the following line and check again. Remember to uncomment all the other lines once you've found the problem line and fixed or removed it.

If you check all the lines and the problem persists, move on to the next section.

Problems with file or directory permissions

Files and folders should have specific permissions set for them. You can see what they're set to and change them by going to the File Manager in your cPanel and look for "Permissions."

The permissions should be:

Folders – 0755

Files - 0644

If nothing here solves the problem, don't hesitate to contact us on live chat or submit a ticket to help you get it sorted and your site back online.

Problems with WordPress themes and plugins

Sometimes a 500 error can be caused by a plugin or theme.

If the error shows up after you've installed a new plugin:

  • Go to your File Manager
  • Go to the public_html/wp-content/plugins folder
  • Rename the folder for each plugin one at a time

If the error shows after you've installed a new theme:

  • Go to your File Manager
  • Go to the public_html/wp-content/themes folder
  • Rename the folder for the theme

If that fixes the site, try reinstalling the theme or plugin. If it throws the error again, change the name and leave it.

Problems with your PHP code

Issues with PHP can also cause a 500 error. Make sure you have PHP error reporting turned on so you can look and see there's a possible problem. You can turn it on by doing the following:

  • Go to File Manager in your cPanel
  • Go to the public_html directory
  • Please create a new file and name it php.ini
  • Edit this file and put this in it

display_error = off

log_errors = On

error_log = "error.log"

If your PHP code initiates external connections (Grabbing an RSS feed, etc.), make sure you include a time-out handler. If a PHP script times out in a clunky way, it can throw a 500 error.

Also, make sure PHP applications have enough memory allocated to them. If it's too low, it will cause a fatal error.

display_error = off
log_errors = On
error_log = "error.log"

Other Common Error Codes Beginning with Five (5)

501 not implemented

The server cannot fulfill the request, or it simply doesn't understand what it's requesting. The request method may not be valid, or the server may not support the request method. In some cases, there may be software on the server that needs to be updated, often when something isn't available yet, like new features introduced to an API.

502 Bad Gateway

The server received a request from another server that's not valid. It may display in various ways, including:

  • 502 Bad Gateway
  • 502 Service Temporarily Overloaded
  • Error 502
  • Temporary Error (502)
  • HTTP Error 502 – Bad Gateway
  • 502 Proxy Error
  • HTTP 502
  • 502 Server Error: The server encountered a temporary error and could not complete your request
  • 502. That's an error
  • Bad Gateway: The proxy server received an invalid response from an upstream server

You'll also often see "nginx" on the screen.

These errors are often just a quirky problem between servers online that you don't have any control over. Other times it may be a problem with your browser. If you see this error, try clearing your cache, checking your internet connection, and checking if the site works in another browser or from another connection. If it persists, please get in touch with us!

504 Gateway Time-out

This error is similar to the 502 one, but it simply isn't getting a request instead of not fulfilling the request. A problem with the server is most likely, or you may be running scripts that require more time to run entirely.

First, refresh the page to see if it persists. If it does, you can try to fix this:

  • Make sure the .htaccess file is correct, especially if you've recently installed WordPress
  • If your site is running on WordPress, one or more of your databases may have become corrupt. There's a plugin that might be able to help – WP DBManager. Use its repair feature, then use the optimize option and see if that fixes it.

505 HTTP Version Not Supported

The server doesn't support the HTTP protocol used in the request. Try using a different browser and see if it works, as it could be a problem with an outdated browser.

506, 507, 508, 510, 511 Errors

  • You could see several other errors like these. The cause and solution will be dependent on where you see this. For example, are you seeing the error on a WordPress site or one of our cloud/dedicated servers? If you happen to see any odd errors like this, don't hesitate to contact us to get a tech on it and help you get it resolved.

Written by Michael Brower  /  December 13, 2016