# Diagnose a PHP 500 error
Source: https://docs.webgee.com/en/development/php-500-errors-and-how-to-resolve-them



Your site returns **500 Internal Server Error**. Applies to shared, reseller and
Premium hosting.

A 500 is deliberately generic — the detail is in the log, not the page.

## Start with the log [#start-with-the-log]

Nothing else here is worth trying first:

```bash
tail -n 50 ~/public_html/error_log
```

Or open `error_log` in File Manager with hidden files shown — see
[Find your error log](/en/development/how-do-i-find-my-error-log-file-to-find-errors-for-my-php-application).

The entry names the file and line. That is usually the whole diagnosis.

If the file is empty or missing, turn logging on — see
[Enable error logging in PHP](/en/development/how-do-i-enable-error-logging-in-my-php-script).

## Constant or intermittent [#constant-or-intermittent]

The pattern narrows it considerably:

| Pattern                       | Usually                                       |
| ----------------------------- | --------------------------------------------- |
| **Every request, every time** | A code or configuration fault                 |
| **Sometimes, under load**     | A resource limit — memory, or entry processes |

## Constant 500s [#constant-500s]

**A fatal PHP error.** The log names it. Typically a plugin or theme calling
something that does not exist after an update, or a syntax error in a file you
just edited.

**A broken `.htaccess`.** Rename it to `.htaccess.bak` and reload. If the site
comes back, the file is the cause. A single mistyped directive does this — see
[Force HTTPS](/en/security-ssl/force-https) for one that used to be documented
incorrectly here.

**Wrong permissions.** Files that are group- or world-writable are refused by
suEXEC. Set directories to `755` and files to `644` — see
[File and directory permissions](/en/hosting/what-file-and-directory-permissions-should-i-use-for-my-web-files).

**An unsupported PHP version.** An application requiring a newer version than the
one selected. See
[Change your PHP version](/en/development/change-php-version).

## Intermittent 500s [#intermittent-500s]

Usually a resource limit reached under load.

**Memory.** Raise `memory_limit` in **Select PHP Version → Options** — see
[Understanding PHP memory limits](/en/development/understanding-php-memory-limits-in-shared-hosting-environments).
If the site needs far more than the default, something is wrong: investigate
rather than raising it repeatedly.

**Entry processes.** Requests killed at the limit produce a 503, but a partly
served request can surface as a 500. Check **cPanel → Resource Usage** — see
[Fix a 503 Resource Limit Reached error](/en/performance/understanding-and-resolving-the-503-error-resource-limit-reached).

## WordPress specifically [#wordpress-specifically]

1. Rename `wp-content/plugins` to `plugins-off` over SFTP. If the site returns,
   a plugin is responsible — rename it back and disable them one at a time.
2. Switch to a default theme.
3. Enable `WP_DEBUG_LOG` and check `wp-content/debug.log` — see
   [Enable WP\_DEBUG](/en/hosting/wordpress/how-to-view-enable-and-view-errors-on-a-wordpress-installation-wp-debug).

## Related [#related]

* [Find your error log](/en/development/how-do-i-find-my-error-log-file-to-find-errors-for-my-php-application)
* [Understanding PHP memory limits](/en/development/understanding-php-memory-limits-in-shared-hosting-environments)
