500 Internal Server Error

500 Internal Server Error error guide banner

DIRECT ANSWER

A 500 Internal Server Error means the server encountered an unexpected problem while processing the request. The browser usually cannot identify the cause, so start by matching the failure time with PHP, application, and web-server logs. Recent code, plugin or theme changes, `.htaccess` rules, permissions, resource limits, and deployment settings are common causes.

Key takeaways

  • HTTP 500 is a generic server-side response; the browser message rarely identifies the root cause.
  • Match the exact failure time to PHP, application, and web-server log entries before changing files.
  • Recent plugin, theme, module, code, deployment, and .htaccess changes are high-value suspects.
  • Test one targeted change at a time and verify the exact failed URL after each change.
  • Keep detailed PHP and application errors in server-side logs rather than displaying them to visitors on a production site.
Updated 2026-09-24 · Editorial review pending HTTP & Server Errors
SA

Site Administrator

What this error means & how to recognize it

  • The browser shows a blank, generic, or branded 500 Internal Server Error page.
  • A previously working page fails after a code edit, plugin or theme installation, update, deployment, or configuration change.
  • Only certain URLs, forms, admin screens, or site features fail while the rest of the site remains available.
  • A PHP, application, or web-server log records a fatal error, syntax error, permission problem, missing dependency, or resource-limit failure at the same time.
  • Repeating the request produces the same 500 response, although intermittent failures can occur when a resource limit or application dependency is involved.

Root causes, ordered by likelihood

  1. Application code, plugin, theme, or module failure — A syntax error, fatal error, incompatible update, or unhandled condition can prevent the request from completing.
  2. Invalid Apache configuration — A malformed or unsupported directive in .htaccess, or a rule requiring a disabled module, can trigger a 500 response. .htaccess applies to Apache-based setups, not all web servers.
  3. Incorrect file or directory permissions or ownership — Manual uploads, migrations, and deployments can leave the web process unable to read required files.
  4. PHP memory or execution-time exhaustion — Large imports, expensive queries, or resource-heavy extensions can exceed configured limits; some environments return 500 when this happens.
  5. Missing deployment configuration or dependencies — A changed database credential, absent environment variable, unavailable package, or incompatible runtime can break the application.
  6. Incomplete or corrupted application or CMS files — An interrupted update can leave required core files missing or damaged.

How to fix it

1Does the response remain 500? If no, verify whether theissue was transient. If yes, continue.2What appears in the logs at the failure time?3Did one targeted change restore the URL? If yes,document and permanently correct that cause. If no, undothe test change and continue with the next log-supportedhypothesis.4Does the error affect every route or one feature?Site-wide failures favor server configuration,deployment, or core-file problems; feature-specificfailures favor that feature’s code or dependency.
Diagnostic flow at a glance — full detail in the steps below.

1. Confirm the scope and timing

Reload the exact URL that returns 500 and record the time, including the timezone. Check whether the whole site fails or only one route, form, admin screen, plugin feature, or request type. A feature-specific failure makes its recent code and dependencies more likely; a site-wide failure points more strongly toward server configuration, deployment, or core files.

2. Check the relevant logs first

Review the PHP error_log, web-server error log, and application or CMS log available on the host. Common locations include /var/log/apache2/error.log for Apache and /var/log/nginx/error.log for Nginx, but hosting layouts vary. Match entries to the failure time and record the file, line number, exception, upstream message, or configuration directive. The generic browser page alone is not enough to identify the cause.

3. Isolate a recent code or extension change

If the log identifies a file, plugin, theme, module, or deployment change, revert that change or disable the named component in a testable environment. On a CMS, use the administration area when it is available. If the admin area is inaccessible, SFTP or the hosting file manager may allow you to rename the relevant component directory. Change one component at a time, then retest the failed URL. If the error disappears, investigate compatibility, configuration, and available updates before re-enabling it.

4. Test .htaccess only on Apache

If the log points to an .htaccess parse error or the failure began after an Apache rule change, make a backup and temporarily rename .htaccess to .htaccess.bak through SFTP or the hosting file manager. Retest the page. If it works, restore or recreate the file carefully and add custom directives incrementally. An unsupported directive or missing Apache module may be the underlying issue. Do not apply this step to an Nginx-only setup, where .htaccess is not used for request configuration.

5. Correct permissions and ownership carefully

When the log reports a permission or ownership failure, compare the affected path with a working file or the hosting provider’s documented settings. 644 for files and 755 for directories are common settings, but the correct values depend on the host and deployment model. Fix the affected path through SFTP, SSH, or the hosting file manager, and do not make files or directories globally writable as a shortcut.

6. Investigate PHP and application resource limits

If the log mentions memory exhaustion, maximum execution time, or a similar limit, identify the operation consuming the resource, such as a large import or expensive plugin task. Adjust memory_limit or max_execution_time in the applicable php.ini, .user.ini, hosting setting, or deployment configuration only if your host permits it. Also reduce the workload or fix the inefficient operation; raising a limit alone may only postpone the failure.

7. Compare deployment settings and required files

For failures that began after a deployment or migration, compare environment variables, database credentials, runtime versions, installed dependencies, file paths, and generated configuration with the working environment. Confirm that required files are present and that the application can reach its configured database or service. Use the log’s named missing variable, package, or connection error as the starting point rather than changing unrelated settings.

8. Restore damaged files only after preserving evidence

If an incomplete update or corrupted core file is indicated, save the relevant log and a copy of the current files before making repairs. Then restore known-good files or rerun the platform’s supported update process, using a backup when available. Retest the original URL and check that no new matching error is being written to the log.

Prevention & how to verify the fix

  • Back up both files and the database before installing or updating a plugin, theme, module, or CMS component.
  • Test code and .htaccess changes on a staging copy when possible, and retain a known-good configuration for rollback.
  • Deploy configuration variables and dependencies consistently between environments, and verify required files after migrations.
  • Monitor PHP, application, and web-server error logs rather than relying only on external availability checks.
  • Make one change at a time, record what changed, and retest the exact URL that failed.
  • Keep detailed diagnostics in server-side logs instead of displaying them to visitors on a production site.

When to get outside help

Contact your hosting provider or application developer when you cannot access the relevant logs, the error continues after reverting the last known change, or the log indicates a host-level module, permission, PHP-runtime, database, or resource issue you cannot change. Provide the exact URL, failure time and timezone, recent changes, and the relevant log entry. Do not send passwords, API keys, or other sensitive environment values. If the failure began after a migration or deployment, have the responsible person compare the working and failing environments.

Run a website check

Frequently asked questions

What does a 500 Internal Server Error mean?

It means the server encountered an unexpected condition while processing the request and could not provide a more specific response to the browser. The status code does not identify the root cause; the corresponding server or application log usually provides the useful detail.

Is a 500 error caused by my browser or internet connection?

Usually not. HTTP 500 indicates a problem while the server handled the request. Retry the exact URL to confirm the behavior, but focus troubleshooting on the server, application, configuration, and deployment logs.

Why does a 500 error happen after editing .htaccess?

On Apache, an invalid directive, malformed rule, or rule that depends on an unavailable module can prevent the request from being processed. Back up the file, temporarily rename it, and check the Apache error log before recreating the rules. This does not apply to Nginx-only configurations.

How do I fix a 500 error caused by a WordPress plugin or theme?

Use the PHP or application log to identify the component when possible. Disable or revert that specific plugin or theme, using SFTP or the file manager if the administration area is unavailable, then retest the failed URL. If the site recovers, investigate compatibility, configuration, or an available update before re-enabling it.

Can incorrect permissions cause a 500 Internal Server Error?

Yes. If the web process cannot read or execute a required file or directory, the request may fail. Correct the affected path using the hosting provider’s expected ownership and permission settings; making everything writable is not a safe general fix.

What should I do if I cannot see the error log?

Ask your host to check the PHP, application, and web-server logs for your account at the precise time of the failure. Shared hosting panels may not expose every log even though the provider can retrieve it.

Further documentation

For authoritative environment-specific details, consult the documentation for the web server in use, such as Apache HTTP Server or Nginx, along with the PHP documentation for error logging and runtime limits. Also consult the documentation for the relevant CMS, framework, hosting control panel, or deployment platform for its log locations, permissions model, recovery process, and configuration requirements.