Website 500 Internal Server Error Fix


You are trying to setup new script and suddenly getting 500 Internal Server Error on all pages. This is generic error message and no details are provided as what is the actual cause of error.


Check .htaccess file of your script

If there is nothing broken from server itself most of the time internal server error are because there are some rules in .htaccess which are not compatible with server environment. In order to do quick check rename .htaccess to htaccess_backup and now access site after clearing browser cache. Use ctrl + f5 in browser for quick refresh invalidating cache.

If 500 Internal Server error is gone now then it means some rules in .htaccess provided by your script are conflicting in server environment.

Open original .htaccess file and examine the code, Depending upon the way PHP + Apache is setup it might not allow php_flag and php_value in .htaccess which are used to override default PHP parameter. Remove all php_flag and php_value rules and try again.

There can be other incompatible code in .htaccess for example specifying PHP handler which is not required on your server or rules to disable mod security while there is no mod security setup on server.

You can remove rule one at a time from .htaccess and see which rule is causing 500 Error.

Check Server Access Logs

Login to cPanel -> Raw Access Logs

Check the log file to see if there is any specific error given with 500 Message by Apache, Logs will read like
87.98.217.58 - - [05/Sep/2016:23:03:58 -0700] "GET /index.php?do=/blog/310996/ HTTP/1.1" 500 21 "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Dragon/36.1.1.21 Chrome/36.0.1985.97 Safari/537.36"

If you see 500 21 in access log then it might give details as why 500 is being thrown.

Leave a comment

Your email address will not be published. Required fields are marked *