What is HTTP error 500 and how to fix it
Short answer
HTTP error 500, also called Internal Server Error, means a web server could not complete a request because of an unexpected problem on the server side. It is a generic status code, so the exact cause must be found in logs, recent changes, or hosting conditions. Users can often retry or report details, while site owners can check configuration, code, plugins, themes, and resources.
Key points
- A 500 response means the server failed while handling a valid request.
- The message is generic and hides the exact cause for security.
- Common causes include bad configuration, code errors, database problems, and low resources.
- Visitors should retry, test other pages, and report useful details.
- Owners should read logs first and change one thing at a time.
What is HTTP error 500?
HTTP error 500, formally called Internal Server Error, appears when a web server receives a request but cannot complete it because of an unexpected problem on the server side. The browser is usually working correctly, and the network connection may be fine, so the failure sits with the website or an intermediary service. Because the code is generic, the message does not say whether the cause is a bad configuration file, a code bug, a database failure, or a lack of memory. That vagueness is intentional: it prevents the server from exposing details that could help an attacker. For a visitor, the practical meaning is simple: the page cannot be shown right now, and the site owner must investigate.
How HTTP status codes work
HTTP is the protocol browsers and servers use to request and deliver web pages, images, scripts, and data. After a request, the server returns a three-digit status code that tells the client what happened. Codes in the 2xx range mean success, 3xx mean redirection, 4xx mean the client request has a problem, and 5xx mean the server failed while handling a valid request. A 500 response belongs to the 5xx family, which signals that the responding server failed or could not carry out the requested method. Unlike a 404 Not Found response, which points to a missing page, a 500 response gives no exact cause.
Why the message stays generic
A 500 error can be shown as "Internal Server Error," "HTTP 500," "Temporary Error (500)," or a sentence such as "The site is temporarily unable to handle your request." These wordings describe the same underlying condition. Servers often hide technical details for security reasons, because detailed error output can reveal file paths, software versions, or database information. The generic response therefore protects the site while still telling the visitor that the request failed. The real explanation is usually written to a server or application log that only the owner or administrator can read.
Common causes of a 500 error
Most 500 errors come from a small set of server-side problems. The list below is not exhaustive, but it covers the issues that appear most often in hosting and application logs.
- Misconfigured server files, such as invalid directives in .htaccess, php.ini, httpd.conf, or nginx.conf.
- Errors in website code, including syntax mistakes, logic errors, or fatal errors in recently changed files.
- Database connection problems, such as wrong credentials, an unavailable database service, or a corrupted table.
- Resource limits, including too little memory, disk space, or process capacity for the current traffic.
- Plugin or theme conflicts, especially after updates or when two extensions change the same behavior.
- Software crashes in the web server, application server, or a runtime such as PHP, Node.js, or Java.
- Permission problems that stop the server from reading required files or writing temporary data.
Some failures are temporary. A brief traffic spike, a short database restart, or a momentary service crash can produce a 500 response that disappears after a few minutes. Repeated errors point to a deeper issue that needs diagnosis.
What a visitor can do
If you are browsing and see a 500 error, you cannot repair the server, but you can avoid losing time and help the site owner. Start with simple checks before assuming the whole site is down.
- Refresh the page once. A temporary server hiccup may clear on the next request.
- Wait a few minutes and try again, especially during busy periods or maintenance windows.
- Check whether other pages on the same site work. A single failing page may point to one script or database query.
- Try a different browser or device to rule out a local caching problem.
- Clear the browser cache if the error page seems stuck. A guide such as How to clear browser cache on any device can help.
- If the error continues, tell the site owner the page address, when it happened including your timezone, what you were doing, and any request or error ID displayed on the page. Do not send passwords or other secrets.
If the site is important to you, check its status page or social channels for maintenance notices. A 500 response is not caused by your browser, computer, or internet connection, so reinstalling software or changing your connection will not fix it.
What a site owner should check first
For an owner or developer, the fastest path is to read the logs before changing anything. Logs often name the file, line, or service that failed. Change one thing at a time and test after each change so you do not compound the problem. Back up files and the database before editing configuration or code.
- Review web server and application logs. Apache commonly writes to paths such as /var/log/apache2/error.log or /var/log/httpd/errorlog, depending on the package and configuration. The ErrorLog directive sets the location.
- Look for fatal errors, syntax errors, or missing modules in recently changed files.
- Check database connectivity and credentials, then verify that the database service is running.
- Inspect .htaccess or equivalent rewrite and access rules. A single invalid directive can break every request.
- Confirm that file permissions allow the web server to read application files and write required temporary or upload directories.
- Check memory, disk space, and process limits. Low resources can cause intermittent 500 responses under load.
- Restart the web server or application service after correcting a configuration error, if your hosting environment allows it.
WordPress-specific checks
Many 500 errors on WordPress sites come from plugins, themes, or permalink configuration. If you can reach the dashboard, deactivate all plugins, then reactivate them one by one while testing the site. If the dashboard is unavailable, rename the /wp-content/plugins folder through FTP or a file manager, which disables all plugins at once. Switch to a default theme such as Twenty Twenty, or rename the active theme folder if the admin area is inaccessible. To regenerate .htaccess, rename the existing file, then open Settings, Permalinks, and click Save. These steps isolate the component that introduced the failure.
When errors keep returning
Recurring 500 errors that return after a temporary fix often point to underlying server issues, resource limits, or configuration problems that need hosting provider help. Record when the errors occur, which URLs fail, what actions trigger them, and whether they follow traffic spikes or deployments. Patterns help support teams find the root cause faster. If the site is slow before each failure, resource exhaustion is likely. If failures follow every code deployment, review the deployment process and rollback plan.
When to contact hosting support
Contact support when logs point to server-level failures, when you cannot access the server, or when the error affects every page and does not clear after basic checks. Provide the URL, timestamp with timezone, request or error ID, recent changes, and the exact log lines if you have them. Avoid sending passwords or other secrets. If the host confirms a platform issue, ask for the incident reference and expected resolution time. For a business site, also prepare a fallback page or cached version so visitors see a useful message instead of a blank error.
HTTP, APIs, and related security concepts
HTTP serves web pages and APIs, and both use the same status codes to report whether a request succeeded, failed, or needs authentication. A 500 response from an API means the service failed internally, even if the client sent a valid request. If you build or integrate software, handle 5xx responses with retries, timeouts, and clear user messages rather than assuming the request was wrong. Keep credentials safe: an API key should never be exposed in client-side code or error reports. Malware can also exploit weak server configurations, so review what malware is and its types when hardening a site. For broader context on how requests travel across networks, see How Does the Internet Work? A Guide.
Questions people also ask
Is HTTP error 500 my fault as a visitor?
No. A 500 response means the server failed while handling the request. Your browser, computer, and internet connection are usually not the cause.
Why does a 500 error not explain the problem?
The code is generic by design. Servers often hide technical details to avoid exposing file paths, software versions, or database information.
What should I check first on my own site?
Read the server and application logs first. They often identify the file, service, or configuration directive that failed.
Can a 500 error be temporary?
Yes. A brief traffic spike, database restart, or service crash can cause a short-lived 500 response that clears after a few minutes.
When should I contact hosting support?
Contact support when logs show server-level failures, when you cannot access the server, or when every page fails and basic checks do not help.
Related pages
- Cloud Computing: What It Is and How It Works
Cloud computing is on-demand access to computing resources over the internet, usually priced by use. It replaces buying and running physical servers with renting capacity from a provider. Users can scale storage, compute, and software up or down as needs change.
- How Wi-Fi Works: Radio Waves to Router
Wi-Fi sends data as radio waves between a device and a router. The router connects that local wireless network to the wider internet. Standards such as IEEE 802.11 define how devices share frequencies, range, and security rules.
- What is an IP address and how it works
An IP address is a numeric identifier given to a device on a network that communicates with the Internet Protocol. It identifies the device and helps locate it for communication. IPv4 and IPv6 are the two versions in use today.
- What is net neutrality? A plain guide
Net neutrality is the principle that internet service providers should treat all online traffic equally, without favoring or blocking particular sites, apps, or services. It shapes how broadband companies manage speed, access, and fees. Supporters and critics disagree about whether extra rules help or harm investment, competition, and access.
- What is DNS and How Does It Work?
DNS is the system that translates human-readable domain names into the IP addresses computers use to find each other on a network. It works as a distributed, hierarchical database with caching, so browsers can load sites without users remembering numeric addresses.
- How Does Email Work? From Send to Inbox
Email moves a message from a sender's mail program to a recipient's inbox through mail servers and standard protocols. The sending server looks up the recipient's domain, finds its mail exchanger, and hands off the message for storage. The recipient then reads it with a mail client or webmail, often through IMAP or POP.
How this page was prepared
Before writing, the topic was researched in the sources below. The page then passed automatic quality checks.