How to Troubleshoot “Internal Server Error

0
1559
Internal Server Error

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

Please contact the server administrator, webmaster@******.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.

What is this?

Do not panic. Problems like this do sometimes occur. Let’s find out what really happened.

There are 5 types of errors that usually appear:

  1. Error 400: This error is caused by a syntax error
  2. Error 401: This error is caused because the file you requested requires authentication
  3. Error 403: This error is caused because the file / chmod permissions that you open cannot be read
  4. Error 404: This error is caused because the file / webpage that you open is not found
  5. Error 500: This error indicates that there is a problem on the server. Mostly due to writing errors in .htaccess or PHP configuration (php version and extension) that do not match the script.

If Error 500 occurs on your web, then do the following steps to analyze and fix it:

  1. Refresh your website

Try pressing the F5 key several times. If it’s sometimes not an error, it’s most likely because your website uses CPU resources or RAM beyond the limit specified by your hoster, so the server will protect the resource so that it doesn’t interfere with other customers. This is common in hosting with CloudLinux.

  1. Check file permissions

Make sure the maximum permissions for the file are 644 and for the directory / folder is 755. You don’t need to do CHMOD to 777 so that a directory or file can be manipulated (filled with files, edited, uploaded etc.) because if your hosting uses suExec, then you can operating the file without having to change permissions to 777 which can reduce the level of website security.

  1. Check the .htaccess file

Errors in the .htaccess configuration can also cause internal server errors. The way to check it is to change the name of the .htaccess file in the public_html directory to, for example: htaccess.txt, if you try to reopen your website. If it is normal, it means the .htaccess configuration is problematic. But if it remains an error, it means not because of the .htaccess file.

  1. Check the error_log file

If all three of the above do not solve the problem, try opening the error_log file in the public_html folder. If for example an error appears below:

PHP Fatal error: Out of memory (allocated 262144) (tried to allocate 261900 bytes) in Unknown on line 0
PHP Fatal error: Out of memory (allocated 262144) (tried to allocate 261900 bytes) in Unknown on line 0

That means that your PHP script requires RAM resources to exceed the limit limit specified by your hosting provider, so an error message of 500 appears. This is common in hosting with CloudLinux OS.

  1. If steps 1-4 do not resolve, it is most likely due to the PHP configuration on the server

This often happens if you move from shared hosting to VPS that uses cPanel … You have to tweak cPanel and reconfigure the apachet using easyapache. Adjust the php version and the php extension as in the previous hosting.

If you still can’t solve this problem, immediately contact your hosting support.

NO COMMENTS

LEAVE A REPLY

This site uses Akismet to reduce spam. Learn how your comment data is processed.