You face error 500 (HTTP ERROR 500) in case, when an error occurred during processing an inquiry, but there is no additional information about this error. That is, it's an absolutely general error and can appear due to multiple reasons.
In this article, I will tell you about the main reasons for error 500 occurrence and the ways to fix it.
The first thing you need to do is to check your error log - the file error.log. There's quite a high chance that the reason and place where error 500 occurred will be described there.
Error in .htaccess file
In case you are using Apache web-server, the most probable reason for error 500 is an error in one of .htaccess files. Either you, or your scripts (for instance, installer of any of CMS) have changed .htaccess files and they are incorrect. Check all the .htaccess files by hand; after that you will require no Apache reload.
Error 500 due to an error in php code
Some web-servers are set not to show errors in php code and always return error 500 instead of it. Security-wise, it's absolutely correct and cause no special difficulties to a website owner. The real error can always be seen in your error.log. It's php code error that I've used to make error 500 for illustrating this article:
Errors due to slow script execution
Some scripts can operate extremely slowly. If it takes a script longer than a certain time period (usually, it's 30 seconds) to operate, web server causes its execution and returns error 500 to a user. In this case, the site administrator will see the following text in error.log file:
Fatal error: Maximum execution time of 30 seconds exceeded
Such an error usually occurs due to bad PHP code or to slowly operating database. Do your best to avoid using scripts from beginners or inexperienced programmers.
If you have any questions left or need more details - please, ask a question or leave a comment.