How to fix a 500 internal server error on your website

What a 500 error means, how to find the real cause in server logs, and step-by-step fixes for the most common triggers across WordPress and custom sites.

By the UK Technology Hub teamPublished 4 minute read

The short answer

A 500 internal server error is a generic message meaning something went wrong on the server, without saying what. The real cause is in the server or application logs. Common triggers include faulty configuration files such as .htaccess, code errors after updates, wrong file permissions, exhausted memory, timeouts and crashed application processes. Check what changed recently, read the logs, then fix the specific error.

A 500 error is frustrating because it hides the details: the server knows what went wrong but isn't telling visitors, which is correct for security. Your job is to find the real error message and fix it.

Step 1: Check what changed

Most 500 errors appear right after a change:

  • Plugin, theme or framework updates.
  • Code deployments.
  • Edits to configuration files.
  • PHP or runtime version changes.
  • Hosting or server migrations.

If you can identify the change, rolling it back is often the quickest fix.

Step 2: Read the logs

The logs contain the actual error:

  • Web server error logs for Apache or Nginx, available in most hosting control panels.
  • Application logs: WordPress debug logs, framework logs or your platform's logging dashboard.
  • Serverless or platform logs on hosts like Vercel, Netlify or cloud providers.

Look for errors at the time the 500 occurred. Messages like "PHP Fatal error," "permission denied" or "timeout" point to specific fixes.

Common causes and fixes

Broken configuration files

A typo in .htaccess (Apache) or an Nginx configuration file can break the whole site. Restore a previous version, or temporarily rename .htaccess to test. On WordPress, saving permalinks regenerates a default .htaccess.

Code errors

Syntax errors and fatal errors in plugins, themes or custom code. The log names the file and line. Fix the code, roll back the update or disable the plugin. For WordPress specifically, see our guide to the white screen of death, which shares many causes.

File permissions

Files and folders with incorrect permissions can cause 500 errors, especially after migrations. Typical safe defaults on many Linux hosts are 644 for files and 755 for folders, but check your host's guidance. Never set permissions to 777.

Memory and resource limits

Scripts running out of memory or hitting process limits fail with 500 errors. Increase limits if appropriate, but investigate heavy code or plugins.

Timeouts

Long-running requests, such as imports or slow external APIs, may exceed server time limits. Move heavy work to background jobs, optimise queries and add timeouts with graceful handling.

Application crashes

For Node.js, Python and other applications, the process may have crashed or failed to start. Check process managers and platform logs, and make sure environment variables and dependencies are present.

Missing environment variables

Applications often fail when required settings like database URLs or API keys are missing in the production environment. Check your hosting configuration.

Step 3: Test the fix

After changing something, test in a private browser window and clear caches, including CDN caches. Check several pages and key functions such as forms and checkout.

Redirect problems can look like server errors to visitors; see our guide to fixing "too many redirects".

Prevention

  • Use staging environments to test updates.
  • Deploy with version control so you can roll back.
  • Monitor errors and uptime with alerts.
  • Keep runtime versions supported and consistent between environments.
  • Show a friendly custom error page while logging the details privately.

500 errors on specific pages only

If only some pages fail, the problem is usually in code used by those pages: a specific template, plugin feature, form handler or API call. Compare working and failing pages, check logs for the failing URLs and test the components they share.

500 errors after a deployment

If errors began right after a deployment, roll back first to restore service, then investigate. Compare environment variables, dependency versions and configuration between the old and new releases. Continuous integration with automated tests catches many of these problems before they reach production.

Intermittent 500 errors

Errors that come and go often point to resource limits, timeouts, overloaded databases or flaky external services. Monitor server resources and error rates over time, and look for patterns around traffic peaks or scheduled jobs.

Communicating with users

Show a friendly error page that apologises, offers a way to contact you and suggests trying again shortly. Never expose technical details publicly.

How we help

Our maintenance and support team diagnoses and fixes server errors quickly. Our web development team sets up staging and safe deployments, and our web app developers add error monitoring to custom applications.

Frequently asked questions

Is a 500 error my fault or my host's?

It can be either. Code and configuration changes are common causes, but server problems also happen. The logs tell you which.

Does a 500 error affect SEO?

Brief errors usually don't. Persistent 500 errors can cause search engines to crawl less and eventually drop pages.

Why can't visitors see the real error?

Showing detailed errors publicly can reveal sensitive information. Details belong in private logs.

This guide is general information, not legal, tax or financial advice, and details such as prices, features and rules can change. Product and company names mentioned are trademarks of their respective owners and are used only to identify those products; UK Technology Hub is not affiliated with or endorsed by them.

Related guides

How to fix the WordPress white screen of death

A calm, step-by-step guide to diagnosing and fixing a blank white WordPress page, from recovery mode and debug logs to plugins, themes and memory limits.

All bug fixes & troubleshooting guides