I'm getting a 500 Internal Server Error
If you see an Internal Server Error (http status code 500) then something has gone seriously wrong. It might be our fault, but more often it's due to something that's been misconfigured in your home directory. Common reason are:
You have a bug in your code
If PHP comes across a FATAL error that cannot be handled, then you will get a 500 error. If you are developing a website then this is probably your first stop on the bug-fix highway. Check your error_log files for clues. If you are running a Content Management System (CMS) like WordPress then this could indicate an issue with your theme or a plug-in - try disabling all the plug-ins, see if the issue goes away - if it does, re-enable one at a time until the issue returns to identify the likely culprit.
Syntax error or disallowed directive in .htaccess files
.htaccess files are very sensitive things. You have to treat them with great care or they will bite! The quick and dirty (tried and true) way to work out where your error is, is to simply backup the file and then start hacking chunks of it out until the error goes away.
Common directives that Krystal do not allow in .htaccess files are
- FollowSymLinks - if you need to use this, please replace it with SymLinksIfOwnerMatch - it does the same thing but more securely.
- php_flag php_value php_admin_flag php_admin_value - do not use these in .htaccess, as they will give an error.
Wrong permissions have been set on a PHP script
If the Write bit is set for Other on a PHP file, then a 500 error will result. So, if the last digit of the file's three digit chmod is 7, 6, 3 or 2 then it's going to fail. This is a security feature of the suPHP environment we run. You don't want your PHP scripts to be writeable by just anyone!
PHP files should always be chmod 600, 640 or 644 (although 644 should not be used for scripts containing usernames or passwords.)
Wrong permissions have been set on public_html
It can be easy to accidentally alter permissions on files and directories. If the Write bit is set for Group or Other on this directory then a 500 error will result. The public_html directory should always be chmod 750.
Your account has exceeded it's allowed share of server resources
It is possible that because your account is exceeding it's allowed shared of the server's resources that your processes are either being delayed, or refused access to further memory. In some cases this can cause your website to produce errors. Please read the article - ***How to check your account's resource usage*** - for further information.