HTTP 500 Internal Server Error: What Is Causing iT And Solutions
Joan Vega
The HTTP Internal Server Error 500 typically occurs when the server encounters an unexpected condition that prevents it from fulfilling the request. This post will help you understand the causes of the error and find appropriate solutions.
It is considered a general error on the server side due to a non-specified problem. From the RFC Standards, we have this definition:
The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.
It is not an error in your connection or browser. Rather, it means something has gone wrong with the website.
Generic Error 500 in Chrome browser
The White Screen of Death of Error 500
The “White Screen of Death” (WSOD) is a term used to describe the 500 HTTP error, and other 5XX HTTP error codes when the server cannot serve any content to the user. Some browsers like Safari or Firefox present this white screen:
Firefox does not show 500 error messages
Alternatively, you have browsers that translate the Internal 500 error, showing different informative messages.
Different 500 Error Messages
Although this error may appear in many ways, they all mean the same. The following displays a few examples of how you might see a 500 HTTP error.
“500 – Internal Server Error”
“500 Error”
“500 Internal Server Error. Sorry, something went wrong.”
“500 Internal Server Error”
“500. That’s an error. There was an error. Please try again later. That’s all we know.”
“HTTP 500 – Internal Server Error”
“HTTP 500”
“HTTP Error 500”
“Internal Server Error”
“This page isn’t working at the moment. HTTP ERROR 500.”
“This page isn’t working. – localhost is currently unable to handle this request. – HTTP ERROR 500”
Generic Error 500 shown in Edge browser
When the option to display errors to the user is enabled, and the execution is not interrupted, the server can provide more comprehensive information about errors than when the user encounters a WSOD (White Screen Of Death).
In such cases, the server may display crucial details related to the error, like the file and line number where the error occurred, a description of the error, and sometimes a stack trace.
The following screenshot shows an example of this, detailing a 500 internal server error on a WordPress page:
In the following section, you will come across various scenarios that can lead to the occurrence of the 500 error.
500 Internal Server Error Causes
A Database error while trying to retrieve data. E.g a corrupted Database, or a wrong SQL syntax.
The application throws an error, such as a runtime error, e.g. an insufficient PHP memory, or a PHP execution timeout.
There is an error in the application code. For instance, PHP is trying to include a nonexisting file, or a division by zero is interrupting the execution.
Your server hardware could have a problem. For instance, you have corrupted files due to a disk failure.
There is a server software problem. For instance, php-fpm is misconfigured or your current version has a bug.
How To Fix The 500 Internal Error
As mentioned in the previous section, the causes of the 500 error can be diverse and not always apparent in the browser.
To solve it, check the error logs or print them in the browser for further diagnosis.
When it comes to 500 Internal Server Errors, there’s no one-size-fits-all solution.
Checking error logs can help identify the root cause.
How To Get More Details About The Errors In PHP
The answer is simple: display the errors or inspect the logs. The latter option is preferable, as a 500 internal server error can sometimes cause the execution to break, resulting in nothing but a WSOD (White Screen Of Death).
Hey, just a heads up!
If you have a WordPress website hosted on a Wetopi server, you can easily access your logs with just a click of your mouse.
To enable the logs here you have two options: the first one for generic PHP applications and the second one for sites running WordPress.
How to show and log errors in plain PHP applications
Enable error reporting: add the following line to the beginning of your PHP script:
Additonally, you can also set these directives in the PHP configuration file php.ini
error_reporting = E_ALL
display_errors = On
log_errors = On
error_log = /path/to/php_errors.log
How to show PHP errors in WordPress
You can use the WP_DEBUG constant in th wp-config.php file to show PHP errors with WordPress.This will enable debug mode in WordPress and display all PHP Errors, Warnings, and Notices on the screen.
Locate the wp-config.php file: This file is in the root directory of your WordPress installation.
Open the wp-config.php file: You can open this file using a text editor such as Notepad, TextEdit, or Sublime Text.
Add the WP_DEBUG constant to display the errors: define('WP_DEBUG', true);
And or enable the debug logging to the /wp-content/debug.log with this next constant: define( 'WP_DEBUG_LOG', true );
When 500 internal server error occur in PHP, it is considered an Error level message rather than a Warning or Notice. Therefore, when examining logs or debugging screens for troubleshooting purposes, focus exclusively on Errors and skip Warning and Notice messages.
We are techies passionate about WordPress. With wetopi, a Managed WordPress Hosting, we want to minimize the friction that every professional faces when working and hosting WordPress projects.
Migrating sites to us is free and completely effortless on your part.
No hidden small text. No commitments. No credit card.
Try before you buy.
Privacy Overview
Our Site uses Cookies to identify you. Cookies can store your account identifier, ordering status, personalisation or website tracking.
Here you can manage your preferences regarding Cookies, including not to allow some types of Cookies.
Strictly Necessary Cookies
These cookies are needed for our website to function providing payment gateway security and their essentials. Therefore they are always on but they do not contain personally identifiable information (PII).
Cookie Settings: we store your preferences here to make sure which cookies you accept and which you don't.
Wetopi panel cookies and local storage: we store your user preferences: language, currency, and service token sessions.
Stripe: this is our payment provider and they may set some cookies to help them with fraud prevention and other issues. This is required for our payments to work.
3rd Party Cookies
Google Analytics: help us to deliver better content to our potential users. We have made sure no personally identifiable information (PII) is sent by anonymizing IPs.
Please enable Strictly Necessary Cookies first so that we can save your preferences!