Troubleshooting an HTTP 500 internal server error is like solving a mystery.
You donโt know what exactly happened or why it happened โ all you know is that somethingโs wrong and you need to fix it.
To guide you through the hassle of troubleshooting the dreaded HTTP 500 internal server error, letโs go over what it exactly means and its most common causes and solutions.
What is an HTTP 500 internal server error?
An HTTP 500 internal server error is a general error message. It covers unexpected issues that donโt fit into existing error codes. HTTP 500 errors are difficult to troubleshoot because a range of issues on the server side can trigger them.
Here are some examples of what a 500 error page might look like in your browser:
HTTP 500
HTTP 500 errors arenโt problems with your computer, browser, or internet connection. Instead, theyโre a generic response that catches any unexplainable server error. Youโll see the HyperText Transfer Protocol (HTTP) 500 Internal Server Error when your server issue doesnโt fit another error code.
Other Common Error Codes
HTTP codes show you how your web browser and website communicate. These are some other common error codes you might see on your website:
HTTP 200
This is a standard status code for websites that are performing well.
HTTP 301
This is the code for permanent redirects. For example, say you have two site pages about widgets with duplicate information and one gets more traffic than the other. It makes sense to redirect the low-traffic page to the high-traffic page to improve SEO for your site.
HTTP 302
This code is for temporary redirects. This is for situations where you want to send users to an alternate page for a short amount of time.
HTTP 304
This code shows up when the website youโre requesting hasnโt seen an update since your last visit.
HTTP 403
This code comes from the server when youโre trying to access a restricted URL.
HTTP 404
A 404 code tells your users that your server canโt find that page they requested with their browser. 404 errors are common, and some sites use this to their advantage.
HTTP 405
This is an HTTP response status code error. It tells you that a web browser wants to access your web page and your server has rejected that specific HTTP method. This means that the browser canโt access the requested web page.
HTTP 410
This is a permanent code that tells site visitors that the page theyโre looking for doesnโt exist.
HTTP 413
This code appears when a user tries to upload a file that exceeds the serverโs file size limit.
HTTP 429
This error is a server response to stop sending requests because of overloaded resources. This code might show up if your site needs to make too many API calls to meet a request.
HTTP 503
This code tells users that the server is temporarily unable to load the page theyโre looking for.
Check out this post for a comprehensive overview of error codes.
Potential Causes of a 500 Internal Server Error
A 500 internal server error is, as the name implies, a general problem with the websiteโs server. More than likely, this means thereโs an issue or temporary glitch with the websiteโs programming.
Some potential causes of a 500 internal server error include:
Corrupted or Broken .Htaccess File
A .htaccess file is a text file with important server instructions. These instructions tell your software to enable or disable specific functions. They might help you protect passwords in a directory or restrict user access.
There are many ways to corrupt a .htaccess file. It can happen during plugin installation, file configuration, or while you are working on your server.
A Permissions Error
Permission errors come with file protection. Permissions errors might be bugs, user mistakes, or networking problems. Usually, this error means that the user isnโt allowed to perform the action theyโre trying.
Faulty Third-Party Plugins or Themes
To increase user features and functionality, you might add a third-party theme or plugin to your website. These plugins can be great for your site, but they can also impact site security, bugs, and performance.
These plugins and themes are often created by individuals or small groups. This can be challenging because they may need more time to address bug fixes and vulnerabilities.
Exceeding the PHP Memory Limit
PHP is a server-side scripting language embedded in HTML. PHP is for managing content, databases, session tracking, and more. Each PHP process uses memory, and your hosting account has a limit for each one of these processes.
If a website needs more than this memory limit, you may see an HTTP 500 error.
HTTP Error 500 Browser Compatibility
Most businesses design their websites for maximum browser compatibility. This means that your website is easy to access and use on any browser or operating system. But your site may work perfectly in one browser and have issues or errors in others.
Because HTTP 500 is a catch-all error, you can see this error on any browser and in any operating system.
How an HTTP 500 Error Might Appear
This error can come up on any site you try to visit on a browser. Because itโs such a common error, there are many ways to communicate this code.
- Internal server error
- The page isnโt working
- 500 Internal Server Error
- 500 Server Error
- 500. Thatโs an error.
- HTTP 500.0 โ Internal Server Error
- Error 500
- Error code: 500
- The server returned a 500 Internal Server Error
- Temporary Error (500)
How to Fix a 500 Internal Server Error
Unlike other server-side errors like a 502 code, a 500 internal server error is it doesnโt immediately tell you what the problem is, nor does it tell you how to fix it. If the error persists for too long on your site, it could even negatively impact your SEO.
So, letโs dive into some solutions so you can try to fix the issue.
If Youโre Trying to Load a Page with a 500 Internal Server Error:
1. Refresh the page.
This might seem obvious, but if itโs a temporary loading issue, you might find success if you refresh the page. Before trying anything else in this list, reload the page and see what happens.
2. Come back later.
Since the error is on the server side, Iโm willing to bet the website owners are working as quickly as possible to resolve the issue. Give it a few minutes or up to an hour or so, and then reload the URL and see if the development team has fixed the issue.
3. Delete your browserโs cookies.
If clearing the browser history doesnโt work, you might try deleting your browserโs cookies. If the cookies are associated with the error-prone webpage, deleting the cookies might help reload the page.
4. Paste your URL into the website โDown for Everyone or Just Me.โ
Head to downforeveryoneorjustme.com and paste in the URL where youโre seeing the internal server error. Youโll either be told that the website is only down for you, or that the website is down for everyone.
If itโs a problem with your server, this should help assuage any concerns that itโs an issue with your own computer.
If the 500 Internal Server Error is on Your Own Website:
1. Deactivate a plugin or theme.
Newly activated software, add-ons, or third-party scripts might be conflicting with your current server configuration. To determine this, try (carefully) deactivating or uninstalling your software add-ons one at a time to identify what exactly is causing the internal server error.
If you run a WordPress website, this is easy to do with plugins. From your dashboard, choose Plugins > Installed Plugins, then deactivate the first plugin. If the error resolves, you know this plugin is part of the issue. Reactivate the first plugin, then repeat this deactivate-reactivate process one at a time for all plugins to determine which ones are causing your error.
You might find that having fewer active plugins on your site helps things run more smoothly.
Alternatively, if you just upgraded your software, your current plugins or themes might not be compatible with the new upgrade. Deactivating plugins or themes one at a time until the error disappears is the best way to find the root cause of your problem.
2. Use a plugin like WP Debugging to identify the issue.
If your site is powered by WordPress and youโre comfortable with WordPress debugging processes, consider installing a plugin to help you identify the issue with your server.
The debug plugin WP Debugging, for instance, helps you figure out exactly whatโs wrong with your site, which will result in a speedier fix.
3. Ensure your PHP setup is configured correctly.
If the issue is related to a PHP timeout, consider creating timeout rules or error handling in your script to resolve the issue. Hereโs a full list of php.ini directivesto configure your PHP setup.
Additionally, wrong permissions on a file or folder that has a script, like a PHP or CGI script, wonโt allow the script to run. Check your permissions and make sure you set them correctly on your server.
4. Check the code for your siteโs .htaccess file.
Incorrect coding or improper structure with your .htaccess file could be the reason youโre seeing the 500 internal error. The .htaccess file helps you manage how long resources should be stored in a browserโs cache. Try editing the file if youโre seeing a 500 internal server error.
To locate your .htaccess file, access your website files through a file manager like cPanel or via FTP/SFTP. The file will probably be located in your public_htmldirectory. Thereโs a good chance your server will hide this file from view by default and youโll need to toggle hidden files on to see it.
Coding errors in .htaccess and custom scripts can also cause an HTTP 500 internal server error.
5. Ensure your new software is installed correctly.
Finally, check to see if your recently installed or upgraded software actually failed to install or upgrade. To refresh your software, check the vendorโs website for instructions.
Last Resort: Ask a Server Administrator for Help
If troubleshooting popular software problems or debugging server-side scripts doesnโt fix your HTTP 500 internal server error, you should read about the most common causes for this type of issue in your serverโs documentation โ an HTTP 500 internal server error can occur in different operating systems for a multitude of reasons.
You can also ask your service provider to access your error logs and find evidence of the root cause of your problem.
Internal server errors are irritating because theyโre unhelpful โ itโs basically the web serverโs way of saying, โEh, Iโm not sure.โ Hopefully, one of the above steps will resolve the problem so you can get back to life as usual.
Editorโs note: This post was originally published in October 2018 and has been updated for comprehensiveness.