I'm getting a 500 Internal Server Error
A 500 Internal Server Error means something went wrong while the server was building your page. The browser is deliberately shown nothing more than that - the detail stays on the server, which is why the page itself never tells you anything useful. Almost always the cause is in your own site's code or configuration rather than the server.
A 500 error writes a line to your log giving the file and the line number that failed. In cPanel look under Metrics > Errors, and check the
error_log file in the same folder as the page that broke. Our guide on finding your server and PHP error log files covers both.That one step turns this article from a checklist into a single lookup. Everything below is for when the log doesn't make the cause obvious.
Seeing a 503 rather than a 500? That is a different problem, and this article is not it - a 503 usually means your account has hit a resource limit or PHP has stopped responding. See how to check your account's resource limits instead.
If you’re the Developer/WebMaster
Most 500 errors come from your site's own PHP failing in a way it cannot recover from. The most common causes 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 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. You could also enable wp-debug mode which may show an error that'll give you a clue as to what's not working correctly.
Site Timeouts
These can be internal or external resources that your site code pulls from which cannot finalise the executed code. The best way to resolve these is to add a raw debugging method to your site code to allow you to find out which process in your script is causing the site to ‘hang’.
Syntax error or disallowed directive in .htaccess files
A syntax error in your .htaccess file will almost always cause a 500 Internal Server Error. The easiest way to confirm if this is due to the .htaccess is to simply rename the file to something else and refresh your site page.
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.To change a PHP setting such as memory_limit or max_execution_time, use cPanel > Software > Select PHP Version > Options instead - our guide on changing your PHP version, extensions and options covers it. Putting a php.ini file inside your website will not work either; our servers ignore them.
You recently changed your PHP version
If the site broke immediately after you switched PHP version, that is almost certainly the cause. An older theme, plugin or script may use something the newer PHP has removed. Switch it back in cPanel > Software > Select PHP Version to confirm - if the site returns, you know what to fix before trying again.
Wrong permissions have been set on a PHP script
Our servers will not run a script that anyone other than you could write to - they return a 500 instead. So a file left more permissive than it needs to be doesn't just weaken security, it stops the page working.
In practice that means 664, 666, 775 and 777 will all give you a 500. The first two of those are worth knowing about, because 664 and 775 are exactly what a badly configured FTP client tends to leave behind - they look harmless, and they are not.
The values you want are 644 for files and 755 for folders. Configuration files that hold passwords - wp-config.php, for example - are better at 600, and anything run from the shell or as a CGI script needs 700. If you have been changing permissions and the page has since started returning a 500, putting files back to 644 is the first thing to try.
We have a separate guide on setting the correct file permissions for your web files.
Your account has exceeded its allowed share of server resources
PHP Scripts often need optimising to stop them from exceeding resources assigned to your cPanel account. If you’re seeing the resources in cPanel peaking or hitting max capacity, there are a few changes you can make such as staggering your cron jobs. Please read our article on how to check your account's resource usage.
If you’re on WordPress you may need to disable your WordPress CRON and setup configurable cPanel CRON tasks.
If you’re not a Developer/Webmaster or are having issues
Try working through the steps above using our various guides which should help you gather more of an understanding of the error and if this is something you can fix, if you’re still having issues get in contact with us, we can check to see if there’s anything glaringly obvious or if it is server-side, in the event that it isn’t It may be worth restoring from a backup.
If this doesn’t work, you would need to have a developer look over your site code. We will do our best to provide you with any error codes and sign-post you in the right direction.