Internal Server Error or error 500

Table of contents:

Internal Server Error or error 500
Internal Server Error or error 500
Anonim

Check the logs to find out why the 500 error occurs. There may be an entry in the error.log file indicating the cause of the problem. Consider the most common options.

Lack of resources

If this is the reason, the problem is solved very simply - contact the hosting provider with a request to increase resources.

The presence of inoperable scripts or a limited time for their execution

error 500
error 500

If the server fails to process scripts for a certain amount of time, often a minute, a 500 Internal Server Error occurs.

Also, webmasters may encounter a similar error if they run a CGI script from under Apache, if the time specified in the server settings is not enough to execute the script.

If the scripts were previously working, and problems appeared, for example, when moving to another hosting, the problem may be caused by other reasons. For example, the fact that the server blocks requests.

Errors in setting access rights

http 500 internal server error
http 500 internal server error

File permissions must be 444 or 644. CHMOD for folders must notdifferent from 755, i.e. only the owner of the resource can view them. Script permissions must be set to 600. Otherwise, for security reasons, the server blocks access to the script, even if it is functional.

If this is the reason for the 500 error, use the FTP manager to change the permissions. Filezilla does a great job with these functions.

The.htaccess file contains unsupported directives

Check if the.htaccess file is present in the root of the site or elsewhere. If there is one, open it with any text editor. You can use Notepad.

Error 500 may appear if you are using a server running on suPHP, i.e. supporting php.ini. If there are directives in the.htaccess file that change the parameters of the PHP environment, problems may arise. The most common directives are php_admin_flag, php_flag and php_value.

Global variables are often included as instructions - Register Globals.

This problem is solved very simply - unwanted parameters can be simply deleted. Another option is to comment them out by adding asign to the beginning of the line. There must be a space between the pound sign and the name of the directive.

If you absolutely need to execute commented parameters, they can be written in the php.ini file. In this case, you do not need to use php_admin_flag, php_flag and php_value - just designate them according to the principle: "required parameter name=On".

PHP fatal error

error 500 internal server error
error 500 internal server error

This problem can occur if PHP works like CGI. In this case, you need to carefully check the program code, diagnose and fix errors. Note that CGI script line endings must not be in Windows format (r\n), but must be in UNIX format (n).

If none of the suggested solutions fix the error, contact your host. Explain in detail to him when and after what actions the 500 error appeared. Ask him to indicate the causes of the problem and help in fixing it. In case the hoster is unable to figure out why the http 500 Internal Server Error occurred, please contact the support of the CMS you are using. Be sure to include all the details in the letter, incl. - hosting provider's comments regarding your situation.

Recommended: