How to fix the Internal Server Error 500
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,
.htaccessedit, 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:
- In cPanel search for Errors (or Error Log).
- Look at the latest lines for your domain: they show the file path and the exact line that broke.
- 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):
| Type | Permission |
|---|---|
| PHP, HTML, image files | 644 |
| Directories | 755 |
wp-config.php, configuration.php | 600 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:
- In File Manager go to
public_html/. - Rename
.htaccessto.htaccess.bak. - 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).
- In cPanel open Select PHP Version (or MultiPHP Manager).
- Switch to a compatible version (recommended PHP 8.2 or 8.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.
- In Select PHP Version → Options, raise
memory_limitto256M. - 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.
- Check
wp-config.phporconfiguration.phpand confirm user, password and database name. - In cPanel open MySQL Databases and verify the user has All Privileges on the database.
- 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.
Quick diagnosis (recommended order)
- Read the error log.
- Rename
.htaccessand reload. - If you use WordPress/Joomla/PrestaShop, disable plugins/extensions over FTP.
- Change PHP version to the recommended one.
- Raise
memory_limittemporarily. - 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
.htaccesswithout a backup: always rename to.bakbefore deleting. - Raising
memory_limitand 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.
Recommended readings
Still need help?
If this guide didn’t solve your issue, our team can help you via ticket.