What is a 500 internal server error? Print

  • 0

A 500 internal server error means that your browser is showing a friendly error message. This is shown instead of the actual error message from the server. You can disable friendly errors in your internet browser. This will show you the real error from the server.

To disable this in Internet Explorer 6.0:

Go to Tools, Internet Options >> Click the Advanced tab >> Scroll the window down a little, and uncheck 'Show Friendly Error Messages'.

******************************************************************************

1:

******************************************************************************

500 Internal Server Error

Problem:

My website is showing a "500 Internal Server Error! What is this?"

Solution:

500 Internal Server Error can be caused by many things, including but not limited to invalid permissions, invalid ownership, bad lines in your php.ini or .htaccess file, invalid requests in the script, and others not mentioned here. Typically this is not a problem with the server itself, and most always can be resolved by modifying something in your site's configuration.
A Server 500 error will generally look something like this:<

Due to the number of situations that can cause a 500 Internal Server Error, it is not possible to cover all scenarios in this article. Should you find something not capable of being resolved with the advice here, please contact us bluehost.com/contact_us.html, and our Support department would be happy point you in the right direction for resolution.

Finding out what is causing the 500 Server Error

Here are some basic steps that you can use to find out what is causing the error.
  1. Open the Error Logs tool, located in the Logs section of the cPanel.
  2. Reload the web page that is causing the error.
  3. Search the error logs for your IP Address for any errors associated with it, your IP address is located at the top of the page.

There are 3 main reasons why you will see this error:

File or Folder Permissions
Bad code or syntaxes in your .htaccess
Improperly configured php.ini

File or Folder Permissions

In this scenario, your account has a folder with an invalid permission set. To correct this, simply restore the permissions to "755" from "777." 
While each site can be different, the following permissions are most often the correct permissions to use:

  • Files - 644
  • CGI Scripts - 755
  • Directories - 755

You can modify permissions with the File Manager, located in the Files category of the cPanel, an FTP client, or using the "chmod" command in SSH/Bash. 
For more information on how to change File and Folder permissions please see our Knowledge Base article Setting file and user permissions


Bad code or syntaxes in your .htaccess

 

There is a huge range of things .htaccess can do and isn't difficult to use, however if you do not enter the syntax correctly it can result in a Server 500 Error. Some common examples of what could cause an error are listed below.

FollowSymlinks

In this example the error is simple to fix; in the file specified, use a permitted directive--in this case use "SymlinksIfOwnerMatches" instead of "FollowSymlinks", or remove the line entirely. 

Syntax Not Closed

Again, the solution is to simply fix the syntax, or remove it. In this case, close the ending "" directive properly and put the rules on their own line to resolve the problem. These are just a few common examples that can be caused by bad .htaccess parameters. What you encounter will likely vary, however generally the error message is descriptive enough to determine an error from it without further investigation.

Improperly configured php.ini

ForceType

When you are using files with (or without) an extension different then the normal extension for that filetype you can use ForceType in your .htaccess file to make it clear to the server how to handle that file (or all the files in the folder) (this works on servers without phpsuexec).
An example: When you have a file called 'item' (like Nucleus uses for FancyURL's) and want it to be parsed by the server as php you use the following code in your .htaccess file:

However, because our servers use phpsuexec this will result in an internal server error. To solve this you can simply use SetHandler instead of ForceType, so your .htaccess-file becomes:

 

php_value

On a server without phpsuexec it is possible to use the php_value statement in a .htaccess file to change the settings of php (actually overwrite the settings from php.ini). On a sever with phpsuexec this will also result in a server error. To solve this you can use a php.ini file which you put in the same folder as where you would have put your .htaccess file. In that php.ini file you can change all the php values. You only have to put the values you want to modify in that file. By example if you want to set the short_open_tag to Off you would have used short_open_tag? = off in your .htaccess file. Using a php.ini file this results in:

TRIWOR

Uses suphp instead of running php as apache module, thats why 500 error occurs a lot from clientside. In most of the cases 3 issues are concerned regarding the 500 error.

1. Using php values and flags in .htaccess
2. Using a php file which has 777 or 666 permission
3. Putting wrong code in .htaccess (Other than php values)

To solve the 1st problem, use a php.ini file to put all the php values and flags. Previously to enable register_globals htaccess was used and it was defined like this under .htaccess:

php_flag register_globals = On

To enable register_globals just put the following code under a php.ini file created in public_html:

register_globals = On

To solve the 2nd problem, make sure you do not have a php file 777 or 666 permission. If you are unsure which file is 777 or 666 moded then just contact our support center to take care of it, they will make all the files under public_html to 755, and this should solve the problem.

To solve the 3rd problem, just make sure what you are writing in .htaccess are correct. In most of the cases, this is included in 3rd party documentation so its always recommended to contact the script owner / writer to solve such cases if you are unsure about the error.
 


Was this answer helpful?

« Back

Powered by WHMCompleteSolution