Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

500 Internal Server Error: Meaning and How to Troubleshoot It

Separate visitor checks from website-owner fixes, use logs to find the cause, and troubleshoot WordPress, PHP, database, and server configuration errors.

Table of Contents

500 Internal Server Error means a server encountered an unexpected problem and could not complete the request. The code identifies a server-side failure, but does not tell you its cause. For a site owner, the most useful next step is to match the failed request with an entry in the application or server error log.

If you are only visiting the site, start with the visitor checks below. You cannot fix the site's PHP code, database, or server configuration from your browser.

Recognize the error correctly

The message may appear as HTTP 500, Internal Server Error, or a custom “something went wrong” page. These examples show different presentations of a server error.

A blank page alone does not prove that the response is HTTP 500. Check the response status in your browser's developer tools or your hosting logs. Codes 502, 503, and 504 also belong to the 5xx family, but describe different failures; the HTTP status-code reference explains the distinction.

If you are visiting someone else's website

  1. Wait briefly and reload once. A transient server failure may have cleared.
  2. Test another page or a private window. This helps determine whether the problem affects the whole site or only a particular request or session.
  3. Try a hard refresh. A cached error page can remain after the server recovers. If needed, follow the browser cache-clearing guide and clear cached files without unnecessarily deleting passwords or cookies.
  4. Contact the site operator. Include the URL, time, and action that produced the error. Avoid sending private form values or account secrets.

If the error followed a payment or form submission, check whether the action succeeded before submitting it again. Repeated reloads will not repair an ongoing server failure.

If you own the website: preserve evidence first

Record the failing URL, exact time and time zone, recent changes, and whether the error affects all pages, the admin area, or one operation. Keep a backup of files and the database before editing configuration or restoring data. Test changes on staging where possible and change one thing at a time.

Typical causes include an application exception, invalid configuration, exhausted PHP memory, unavailable database service, incompatible plugin or theme, file-permission problems, or an overloaded application service. A browser cache is not usually the cause of the server's underlying failure.

1. Read the relevant error logs

Reproduce the failing request once, then inspect the log around that timestamp. Use your hosting control panel first. Common Linux log paths include /var/log/apache2/error.log and /var/log/nginx/error.log, but paths vary. PHP-FPM and application logs may be separate from the web-server log.

Look for a specific message such as a fatal exception, an “Allowed memory size exhausted” error, an invalid directive, or a database connection failure. A warning elsewhere in the log is not automatically the cause.

WordPress debug logging

On a staging or local copy, WordPress can log errors with these settings in wp-config.php, before the “stop editing” line. Edit any existing definitions instead of duplicating them:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

The default log is wp-content/debug.log. Logs can contain sensitive paths and data, so restrict access, avoid displaying debug errors to visitors, and disable temporary debugging after diagnosis. WordPress also supports a custom log path; follow its debugging documentation for your environment.

2. Check database connectivity

If the error says “Error establishing a database connection,” compare the application's database host, name, user, and password with the values provided by your host. These are separate from your WordPress administrator login.

Check whether the database service is running and whether the database user has the required access. After a migration or password change, configuration mismatches are a useful first lead. If the service is unavailable or connection limits are reached, ask the host to inspect it. Repair or restore tables only when there is evidence of corruption and you have a verified backup.

3. Isolate a recent plugin, theme, or code change

If the failure began immediately after an update, investigate that change first. In WordPress, deactivate the suspected plugin if the dashboard is available. If necessary, test with plugins deactivated, then re-enable them one at a time to identify the failing component. Test a compatible default theme to isolate a theme-related error.

When the dashboard is inaccessible, use your host's file manager or SFTP to temporarily rename the suspected plugin directory. Keep the original name and restore it after testing. Deactivation can disable checkout, forms, or other site functions even when it does not delete stored content, so verify affected workflows.

4. Inspect file ownership and permissions

Use the log to identify the file or directory the server cannot read or write. Many WordPress hosts use 644 for files and 755 for directories, but the correct values depend on ownership and how PHP runs.

Do not apply permission changes recursively as a guess or use world-writable 777 permissions as a fix. Ask the host for the required ownership and permissions, particularly for wp-config.php, uploads, and executable scripts.

5. Adjust PHP memory only when the log supports it

If the log reports exhausted memory, inspect the operation that triggered it and the active memory_limit. In a cPanel-based environment, the host may expose PHP options through Select PHP Version or MultiPHP INI Editor. Menu labels depend on the hosting setup.

Increase the limit only within your hosting plan's supported capacity, then repeat the same operation. A higher limit may help a legitimate workload, but can also mask a memory leak or inefficient plugin.

The directive php_value memory_limit 128M in .htaccess is suitable only for compatible Apache-module PHP configurations with the required overrides enabled. It can itself cause an error in other environments. For PHP-FPM, use the host's supported configuration method instead. See the PHP configuration manual.

6. Check Apache rewrite rules

For an Apache-hosted WordPress site, preserve a copy of .htaccess before testing it. A temporary rename can reveal whether one of its directives causes the failure. It also removes redirects and access rules, so keep the test brief and restore required rules.

If WordPress becomes accessible, go to Settings > Permalinks and save to regenerate its rewrite rules. A single-site installation at the domain root uses a different configuration from multisite or a subdirectory installation; do not paste a universal replacement blindly.

Nginx does not use Apache's .htaccess file. For its routing or PHP configuration, inspect the Nginx configuration and logs with your host.

7. Check core files, CGI scripts, and hosting services

If logs indicate missing or damaged WordPress core files, back up the site and use the supported core reinstall procedure. Preserve wp-content and wp-config.php; replacing core files is different from wiping the installation or restoring its database.

For a CGI or Perl application, inspect the interpreter path, syntax, required modules, execution permissions, and server log. Use the server's documented requirements rather than assuming every script needs the same encoding or upload mode.

When logs point to an unavailable service, resource exhaustion, or an issue outside your account, contact the host with the timestamp, request path, relevant error, and changes already tested. Ask it to inspect the application workers, database, storage, and upstream services. Avoid exposing credentials in the support message.

What persistent 500 errors mean for SEO

Google reduces crawling when it encounters server errors and can eventually remove URLs that persistently fail from the index. There is no universal “safe for ten minutes” or “penalty after six hours” rule. A 503 response for temporary maintenance is still a server-error response, so prolonged unavailability needs attention.

After the fix, test representative pages and important actions, confirm they return the appropriate successful status, and monitor logs for recurrence. Google's HTTP status-code guidance explains how server errors affect crawling.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.