What is a 500 internal server error?

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:

A 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: <
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@domain.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

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


[Sun Jun 05 12:03:22 2011] [error] [client 66.249.72.82] SoftException in Application.cpp:601: Directory "/home1/examplec/public_html" is writeable by group

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


    [Sun Jun 05 12:07:10 2011] [alert] [client 66.249.72.82] /home1/examplec/public_html/.htaccess: Option FollowSymlinks not allowed here

    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


    [Sun Jun 05 12:11:38 2011] [alert] [client 66.249.72.82] /home1/examplec/public_html/.htaccess: /home1/examplec/public_html/.htaccess:3: ExampleRule/Module> was 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:

    ForceType application/x-httpd-php

    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:

    SetHandler application/x-httpd-php
    

    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:
    [PHP]
    short_open_tag = Off

    ************************************************************
    In Linux Server

    tail -f /usr/local/apache/logs/suexec_log


    tail -f /usr/local/apache/logs/error_log

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

    2:

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

    Websouls.com

    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.
    • 24 Users Found This Useful
    Was this answer helpful?

    Related Articles

    ..htaccess guidance

      .htaccess guidance .htaccess is a special Apache file that tells your website how to...

    Linux Sites preview Offline

    Linux Site's Preview Offline   http://IP_address/~UserName OR http://ServerName/~userName...

    How to scan your website's data from CPanel?

    Welcome the comprehensive step-by-step guide by our web hosting company on how to scan your...

    How Can I Download a Backup of Full cPanel Account Using FTP?

    If you want to download a backup of your website using FTP, please follow these easy steps below:...

    How to create an addon domain?

    An add-on domain is a fully functional domain and it can be created by using your Cpanel. Add-on...