How to fix the Internal Server Error 500

Category: Web hosting

The HTTP 500 — Internal Server Error is a generic server error: the browser gets no valid response because something failed on the hosting side. The real cause is almost always in the error log; this article walks you through finding and fixing it.

Before you start

  • Access to the affected domain’s cPanel.
  • Know what changed right before the error (install, .htaccess edit, plugin update, PHP switch).
  • Have a recent backup or be ready to take one with Backup Wizard before touching files.

Step 0 — Read the error log

Before guessing, open the log:

  1. In cPanel search for Errors (or Error Log).
  2. Look at the latest lines for your domain: they show the file path and the exact line that broke.
  3. Copy the full message — it tells you whether the problem is PHP, .htaccess, database, or mod_security.

If the log points to a PHP file, jump to the PHP step. If it mentions Invalid command or Options not allowed, jump to .htaccess.

Common causes and fixes

1. Wrong file or directory permissions

Permissions that are too open (777) or too closed trigger 500.

Restore default values from File Manager (select → Permissions):

TypePermission
PHP, HTML, image files644
Directories755
wp-config.php, configuration.php600 or 640

Never use 777 inside public_html: the server rejects it for security.

2. Misconfigured .htaccess

An unsupported directive or disabled module blocks every request.

Isolate the file:

  1. In File Manager go to public_html/.
  2. Rename .htaccess to .htaccess.bak.
  3. Reload the site in incognito mode.

If the site loads, the problem is in the .htaccess. Restore the rules in small blocks until you find the line that breaks.

3. Incompatible PHP version

A plugin or theme requires PHP 8.x and the account is on 7.4 (or vice versa).

  1. In cPanel open Select PHP Version (or MultiPHP Manager).
  2. Switch to a compatible version (recommended PHP 8.2 or 8.3).
  3. Reload the site.

If your app needs specific modules (imagick, mysqli, intl), enable them on the same screen.

4. Exhausted PHP memory

The log shows Allowed memory size of … bytes exhausted.

  1. In Select PHP VersionOptions, raise memory_limit to 256M.
  2. If the script still exhausts it, optimize the offending code or plugin; raising memory without limit only delays the problem.

5. mod_security blocking the request

The log shows ModSecurity: Access denied or a rule ID.

Support can create an exception for that rule. Send the exact ID in your ticket; without it, no tuning is possible.

6. Down database or wrong credentials

The site can show 500 when the MySQL connection fails.

  1. Check wp-config.php or configuration.php and confirm user, password and database name.
  2. In cPanel open MySQL Databases and verify the user has All Privileges on the database.
  3. If the database is down, the error log states it explicitly.

7. Corrupt PHP file or uploaded as binary

Uploading PHP over FTP in binary mode corrupts the line breaks.

Re-upload them in ASCII mode or use cPanel’s File Manager, which uploads cleanly.

  1. Read the error log.
  2. Rename .htaccess and reload.
  3. If you use WordPress/Joomla/PrestaShop, disable plugins/extensions over FTP.
  4. Change PHP version to the recommended one.
  5. Raise memory_limit temporarily.
  6. If nothing changes, open a ticket with the exact log.

Final verification

  • The site returns 200 in an incognito window.
  • The error log gets no new entries when reloading.
  • The cause is documented (which file, which change).
  • There is a backup of the current working state.

Common diagnostic mistakes

  • Editing .htaccess without a backup: always rename to .bak before deleting.
  • Raising memory_limit and forgetting the plugin that exhausts it: always re-check the log afterward.
  • Ignoring browser cache: test in incognito or clear cache.
  • Ignoring LiteSpeed/Cloudflare cache: purge after every change.

Still need help?

If this guide didn’t solve your issue, our team can help you via ticket.