# Fixing 500 Internal Server Errors

> Your website shows "500 Internal Server Error". Here's how to find the cause in your error logs and fix .htaccess, PHP and permission problems.

Source: https://helpcenter.ruachost.com/getting-started/website-troubleshooting/fixing-500-internal-server-errors/

**500 Internal Server Error** means something went wrong on the server while building the page, but the server can't say what. The cause is almost always in your website's files, and the error logs tell you which.

## 1. Read the error log

- cPanel → **Metrics → Errors** shows the latest web server errors with the reason, such as a bad `.htaccess` line or wrong permissions.
- The `error_log` file in your website's folder shows PHP errors. See [Finding PHP error logs](https://helpcenter.ruachost.com/developers/php/enabling-php-error-logging/).

The newest entries at the bottom usually name the exact file and problem.

## 2. Check .htaccess

A mistake in `.htaccess` is the most common cause.

1. In cPanel's **File Manager**, click **Settings** and tick **Show Hidden Files**.
2. Rename `.htaccess` in your website's folder to `.htaccess-old`.
3. Reload your website.

If it works, the problem is in that file. Look for lines you added recently, especially `php_value`, `php_flag`, `AddHandler` or `Options` lines, and remove them. For WordPress, create a fresh file by going to **Settings → Permalinks** and clicking **Save Changes**.

## 3. Check for PHP errors

If the error log shows a PHP **Fatal error**:

- **A plugin or theme caused it.** In WordPress, rename the folder `wp-content/plugins` to `plugins-off` to turn off all plugins, then reload. If the site works, rename it back and turn plugins on one by one in the dashboard to find the faulty one.
- **You changed PHP version.** Switch back in cPanel under **Select PHP Version**. See [Resolving common PHP upgrade issues](https://helpcenter.ruachost.com/developers/php/resolving-common-php-upgrade-issues/).
- **The script ran out of memory.** See [PHP memory limit vs your plan's RAM](https://helpcenter.ruachost.com/developers/php/resolving-the-allowed-memory-size-exhausted-php-error-message/).

For what PHP error messages mean, see [Common PHP errors](https://helpcenter.ruachost.com/developers/php/common-php-errors/).

## 4. Check file permissions

Folders must be `755` and files `644`. Files or folders with `777` permissions, or PHP files that anyone can write to, are blocked for security. Fix them in File Manager with **Change Permissions**.

## 5. Restore a working copy

If you can't find the cause, restore your website files from yesterday's backup. See [Restoring files, email and databases using JetBackup](https://helpcenter.ruachost.com/cpanel/files/restoring-files-email-and-databases-using-jetbackup/).

## Still seeing 500?

[Open a support ticket](https://dashboard.ruachost.com/submitticket.php) with the page address and the time of the error. We'll check the server logs for you.

## Related articles

- [Fixing the 500 Internal Server Error while running PHP](https://helpcenter.ruachost.com/developers/php/fixing-the-500-internal-server-error-message-while-running-php/)
- [My website isn't working. Where do I start?](https://helpcenter.ruachost.com/getting-started/website-troubleshooting/website-not-working-where-to-start/)
