Overview
This article lists several ways to troubleshoot a 500 error on your website.
Background
A 500 error is a general status code that means something is wrong with your site or server. This error can occur for several reasons, many of which are noted below. If the steps in this article do not resolve the error, contact support for further assistance.
Troubleshooting
The first step you should take is to review your site's error logs. The information in these logs may point to the direct cause or at least give you enough information to investigate further. See the following articles for information on how to view your site's error.log file.
Common causes
The following are a few common causes that will make your site throw a 500 error.
Permissions
-
Every file and directory under your website needs to have specific permissions set to run correctly. These permissions will differ based on your site's needs, but if they are set incorrectly, your site may display a 500 error. In general, the permissions should be set as follows.
- Directories — 755
- Files — 644
See the following articles for further information about permissions.
.htaccess file
-
Many websites use an .htaccess file to control how it operates.
If the code in this file is written incorrectly, or the server is not able to run the code, a 500 error may be thrown. Your site's error.log file should indicate what line in your .htaccess file is the cause.
Timeout when connecting to an external server
-
If your site is connecting to an external server, it's possible the connection will time out, resulting in a 500 error. Resolving this is ultimately up to the admins who manage the other server to ensure it responds in time. However, you can raise your PHP execution time using a phprc file to help mitigate this issue.
Hitting the PHP memory limit
-
Hitting the PHP memory could also cause a 500 error. See this article for instructions on how to raise this limit.
Syntax errors
-
Syntax errors in a website's code could throw a 500 error. Check your site's error.log or enable error logging within your programming language to catch such issues.
WordPress
Everything mentioned above applies to WordPress sites. However, there are a few additional things that could cause this error.
Plugins
-
Try disabling your plugins. This may help to identify a single plugin causing the error.
Reinstall your core WordPress files
-
Reinstalling your core WordPress files downloads a new copy of your WordPress /wp-admin and /wp-includes directories. This could potentially fix your site if something with those files is causing the 500 error. See this article for further information.
Enable WordPress DEBUG mode
-
See this article for instructions on how to enable WordPress DEBUG mode and write to a local log file. This may help to discover the cause of the error message.