500 Internal Server Error: Why You’re Getting It and How to Fix It Professionally (cPanel / WordPress / OpenCart)
A 500 Internal Server Error is a “generic” server-side failure—something broke on the server, but the browser doesn’t receive the details. The real cause is almost always visible in the server logs (Errors) and is most commonly related to .htaccess, PHP, permissions, or a fatal code error.
Most common causes (expanded and clearer)
1) .htaccess error (most common with WordPress)
An invalid rewrite rule, a forbidden directive, or a module conflict can trigger a 500.
- Often happens after permalink changes, migrations, or a plugin that injects rules
- Can also be inside subfolders (e.g., .htaccess in wp-admin, uploads, etc.)
2) Incorrect permissions or ownership (owner) issues
If files/folders are too restrictive or owned by the wrong user, PHP can’t read/write and the process fails.
- Files: 644
- Folders: 755
- Avoid 777 (insecure and can cause even worse security blocks)
3) Fatal error in a script (plugin/theme/app code)
PHP fatal errors (missing class/function, syntax error, memory exhausted) commonly surface as a 500.
- Often after a plugin/theme update
- Often after changing the PHP version
- Often after a migration (missing file/config)
4) PHP version or missing PHP extensions
If the application is not compatible with the current PHP version (or an extension is missing), it may crash with a 500.
- Example: a plugin requires a specific PHP extension or a minimum PHP version
- After upgrades: an older plugin may start throwing fatal errors
5) Memory limit / timeouts / heavy processes
If memory limits are exceeded or a heavy process stalls, the server may respond with 500.
- Large imports, backups, heavy queries
- WooCommerce operations, large filters, complex searches
6) Corrupted or missing core files
If core files (WordPress/OpenCart) are missing or corrupted, the application can fail and return 500.
Professional fix (fastest step-by-step route)
Step 1: Check Error Logs (most important)
Without logs, diagnosing a 500 is blind guessing. Start here:
- cPanel → Metrics → Errors
Look for keywords such as: PHP Fatal, Allowed memory size, Uncaught Error, undefined function, permission denied, rewrite.
Step 2: Test .htaccess (fast on/off diagnostic)
In the site root (e.g., public_html), rename:
- .htaccess → .htaccess.bak
Then test again. If the 500 disappears, the issue is inside .htaccess. After that, you can generate a fresh .htaccess (WordPress: Permalinks → Save) or restore the correct version.
Step 3: Verify permissions (644/755) and ownership
- Files: 644
- Folders: 755
If you see “weird” permissions or the wrong owner (common after migrations), that’s a strong candidate for a 500.
Step 4: Check PHP version (MultiPHP Manager) and compatibility
cPanel → MultiPHP Manager → select the domain → change the PHP version (if needed).
- If the 500 started after a PHP upgrade, roll back one version and test.
- Then update/replace the conflicting plugin/theme.
Step 5: Disable plugins (WordPress) or extensions (OpenCart)
This is the fastest way to confirm whether the 500 is caused by a plugin/extension.
- WordPress: rename wp-content/plugins to plugins-disabled
- OpenCart: if it started after an extension change, temporarily disable the suspected extension (or use logs to identify the exact file)
If it works, restore the original setup and re-enable items one-by-one to find the culprit.
Step 6: If it’s memory/timeouts
In logs you’ll typically see “Allowed memory size exhausted” or similar. Fix options:
- Increase PHP memory limit (via PHP INI in cPanel, if permitted)
- Disable the heavy plugin/operation that triggers the load
- Enable caching (LiteSpeed: LSCache) to reduce dynamic load
How to confirm you found the real cause
- After renaming .htaccess: the 500 disappears → .htaccess issue
- After disabling plugins: the 500 disappears → plugin/extension issue
- After changing PHP version: the 500 disappears → PHP/extension compatibility issue
- Logs show a specific file/line → you have the exact “culprit”
Option: open a ticket for fast diagnosis (if you want support to pinpoint it)
If you want a quick and precise resolution, open a ticket and include the relevant lines from the Errors log:
https://gohost.mk/submitticket.php
- Subject: 500 Internal Server Error – logs / .htaccess / PHP investigation
- Domain: example.com
- cPanel username: CPANELUSER
- Last change made: plugin update / PHP change / migration
- Attachment: paste from Metrics → Errors (relevant lines)