# 500 Internal Server Error

> Something in your application or server configuration crashed, and the server is deliberately withholding the detail from visitors — the real message is in your error log.

Source: https://cwp.sg/errors/500-internal-server-error/  
Author: Ben Johnson  
Last verified: 2026-08-02

**Also seen as:** HTTP 500, Internal Server Error, white screen of death

## What it means

`500` is the server's way of saying *"your code or configuration failed and I am not going to tell the public why."* That secrecy is a security feature, not an obstacle: error messages leak file paths, database names, and credentials.

**The error page is not the diagnostic. The error log is.** Everything below is about getting to the log, and then reading it.

A blank white page instead of an error page is the same problem seen through PHP's display settings rather than the web server's.

## Why it happens

### A PHP fatal error

A syntax error, a call to an undefined function, an incompatible PHP version, or a hard memory-limit hit. This is by far the most common cause, and it usually appeared the moment you edited a file, updated a plugin, or changed PHP version.

### A bad .htaccess directive

A typo, or a directive the server does not permit. Shared hosts disable directives that could affect other accounts, and using one produces an immediate `500` on every request to that directory and everything below it.

### Wrong file permissions

PHP files that are group- or world-writable are refused outright by suEXEC as a security measure. This bites after uploading files from Windows or extracting an archive that carried its own permission bits.

### Memory exhaustion

A script that tries to allocate more memory than the account is allowed is killed mid-execution. Image processing and large imports are the usual triggers. The log line names an *allowed memory size* explicitly.

## How to fix it

### 1. Read the error log first

Everything else is guessing until you have done this. The log is in your control panel under **Error Log**, or as `error_log` in the directory where the failure happened.

Read the most recent entry and match its timestamp to when you loaded the page. The log names the file and line number. In practice this identifies the cause outright in most cases.

### 2. Rule out .htaccess in ten seconds

Rename it and reload:

```
mv .htaccess .htaccess.bak
```

If the `500` disappears, the file is the cause. Restore it and bisect — comment out half the directives, reload, repeat. If your site is WordPress and you deleted rather than renamed the file, regenerate the default rules by visiting **Settings → Permalinks** and clicking Save.

### 3. Turn on errors for yourself only

Never enable public error display on a live site. In WordPress, log to a file instead:

```php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false); // keep them off the page
```

Errors then land in `wp-content/debug.log`. Turn all three off again when you are finished — a readable `debug.log` is an information leak.

### 4. Correct the permissions

Directories `755`, files `644`, and never `777` on anything:

```
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
```

If a tutorial tells you to `chmod 777` a directory to fix an upload problem, it is wrong and it will produce a `500` under suEXEC, on top of being unsafe.

### 5. Disable plugins without the admin panel

If the `500` locks you out of `/wp-admin`, disable everything over FTP by renaming the directory:

```
mv wp-content/plugins wp-content/plugins.off
```

If the site returns, rename it back and re-enable plugins one at a time until it breaks again. The last one you enabled is the culprit.

## On CWP hosting specifically

Error logs are available in your control panel under **Error Log**, and they are written per account so you only ever see your own.

One CWP-specific note: we run suEXEC, which refuses to execute PHP files that are group- or world-writable. If a file manager or an unzip operation left permissions at `664` or `666`, PHP will `500` until you correct them — this catches people migrating from hosts that do not enforce it.

---

Content Website Platform (cwp.sg) operates the free hosting it writes about; see https://cwp.sg/about/ for the methodology and the commercial disclosure.
