How to tackle "500 Internal Server Error"
I got an email from a client saying that one of his website has been down for a while, and the error message reads "500 internal server error". The 500 error is the web equivalence of Blue Screen of Death of Windows. For unexperience web developers or users it could get very frustrating because you may find yourself trying everything you can but nothing changes. Here is where I usually tackle the problem.
- 500 error is a server side error. If the error is caused by recent changes made to the system, try to revert the changes.
- If you don't belive you have done anything that caused the error. It usually has nothing do to with your script (ie. php). Don't waste time tweaking the script compiler to report the error (i.e. enable PHP error reporting), it won't work. You best bet is to view the server log to find out what went wrong. The best way is to access the server log in command line. FTP doesn't usually give you access to system log unless you are on a private server where you are given full access to.for exmaple:
tail /var/apache2/access_log
tail /var/apache2/error_log - If you are on a shared host that doesn't give you command line access, contact technical support of the host company. They will probably fix it for you, but do ask for access to the system log for future reference.
- If you find the information in the system log doesn't give you enough insights to figure out the problem. Try to wrap your head around these possible causes:
- Is your rewirte engine running in a endless loop? (i.e. there are two page being redirected to each other) If you belive this is the cause, temparily rename .htaccess to something else see if the message changes to something else. If so the problem is in .htaccess.
- There maybe any syntax error in .htaccess. Validate your .htaccess file i.e. http://shop.alterlinks.com/htaccess-validator/htaccess-validator.php
- Have you recently change permission on certain files on your server? If so try to revert the change.





