Fix 500 Internal Server Error
A 500 error means something crashed on the server side. Here’s how to find and fix it.
A 500 Internal Server Error means your application crashed but didn’t produce a specific error message. The server has no idea what went wrong, so it sends a generic 500 response. The real cause is always in the error logs.
Step 1: Check the Error Log
This is the fastest way to find the problem.
In cPanel
- Go to Metrics > Errors (shows the most recent Apache/LiteSpeed errors)
- Or go to File Manager > navigate to your site’s root > look for
error_log
Via SSH
# Last 50 lines of the site error log
tail -50 ~/public_html/error_log
# Or check the global Apache/LiteSpeed log
tail -50 /var/log/apache2/error.log
The error log tells you exactly what failed: a PHP fatal error, a missing file, a syntax error, or a permission problem.
Step 2: Common Causes and Fixes
Bad .htaccess File
The single most common cause of 500 errors. Test it:
mv ~/public_html/.htaccess ~/public_html/.htaccess.bak
If the site loads, the .htaccess is the problem. Common issues:
- Syntax errors (typos in rewrite rules)
- Directives that LiteSpeed doesn’t support
- Conflicting rules from multiple plugins
php_flagorphp_valuedirectives (not supported with LiteSpeed’s LSAPI handler)
For WordPress, reset to the default .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
PHP Fatal Error
The error log will show something like:
PHP Fatal error: Uncaught Error: Call to undefined function xyz() in /home/user/public_html/wp-content/plugins/broken-plugin/file.php
Fix: The error tells you the file and line number. If it’s a plugin, deactivate it. If you can’t access wp-admin:
# Rename the broken plugin's folder to deactivate it
mv ~/public_html/wp-content/plugins/broken-plugin ~/public_html/wp-content/plugins/broken-plugin.disabled
PHP Memory Limit Exhausted
Error log shows:
PHP Fatal error: Allowed memory size of 67108864 bytes exhausted
Increase the PHP memory limit:
- In cPanel, go to Select PHP Version > Options > set
memory_limitto256M - Or add to
wp-config.php(before the “stop editing” line):define('WP_MEMORY_LIMIT', '256M');
Wrong PHP Version
Some plugins or themes require a specific PHP version. If you recently changed PHP versions:
- Go to cPanel > MultiPHP Manager or Select PHP Version
- Try switching back to the PHP version that was working
- Test your site
File Permission Issues
If the web server can’t read your files:
# Fix permissions
find ~/public_html -type d -exec chmod 755 {} \;
find ~/public_html -type f -exec chmod 644 {} \;
PHP Timeout
If the error log shows a timeout, your script is running too long. This usually means a slow database query or an infinite loop.
- Go to Select PHP Version > Options
- Increase
max_execution_timeto300(5 minutes) - If it’s a specific page timing out, optimize the underlying query or process
Step 3: WordPress-Specific Fixes
If you can’t access wp-admin at all:
Deactivate All Plugins via File Manager
- Go to cPanel > File Manager
- Navigate to
public_html/wp-content/ - Rename the
pluginsfolder toplugins.disabled - Try loading your site
- If it works, rename back to
pluginsand activate plugins one by one to find the culprit
Switch to a Default Theme
- In File Manager, navigate to
public_html/wp-content/themes/ - Rename your active theme folder (e.g.,
mythemetomytheme.disabled) - WordPress will fall back to a default theme (Twenty Twenty-Five)
- If the site loads, the problem is in your theme
What to Do Next
- Fix 403 Forbidden Error - if you’re seeing 403 instead of 500
- CloudLinux Resource Limits - check if you’re hitting resource limits
- How to Get Support - stuck? Send us the error log in a ticket
- Upgrade to VPS - if resource limits are causing persistent 500 errors
Last updated 07 Apr 2026, 00:00 +0200.