You're browsing your site and get hit with a blank white page and the single line "500 Internal Server Error." Frustrating? Yes. But fixable. In this guide, we'll walk through a systematic triage—starting with error logs and ending with a working site. No fluff, just commands and checks.
Step 1: Check the Raw Error Log
The server logs exactly what caused the 500. On cPanel, the main Apache error log is usually at /usr/local/apache/logs/error_log (or /var/log/httpd/error_log on some systems). Tail it while reproducing the error:
ssh user@yourserver
sudo tail -f /usr/local/apache/logs/error_log
Hit the failing URL. If you see a line like "Premature end of script headers" or "PHP Fatal error", you've found the root. The log entry often includes the exact file and line number.
What if the log is empty?
Check if logging is enabled. In cPanel, go to Apache Configuration > Include Editor and ensure error logs aren't suppressed. Also check domain-specific logs under ~/logs/ or in your cPanel file manager under access-logs.
Step 2: Inspect the .htaccess File
A corrupted or too aggressive .htaccess is the #1 cause of 500 errors I've seen. Rename it temporarily:
cd ~/public_html
mv .htaccess .htaccess.bak
Now reload your site. If it works, your .htaccess is the problem. Common culprits: malformed RewriteRule, infinite redirects, or syntax from a module not loaded (e.g., RewriteCond without mod_rewrite enabled).
To rebuild a clean .htaccess for WordPress or other CMS, visit Settings > Permalinks and save again (WordPress) or regenerate via your CMS tools.
Step 3: Check PHP Memory Limit and Execution Time
A script that exceeds the PHP memory limit or max execution time triggers a 500. Check your current limits:
php -i | grep memory_limit
php -i | grep max_execution_time
If memory is too low (e.g., 32M), increase it in the PHP selector (cPanel > Select PHP Version > Switch to PHP Options) or via a custom php.ini. A safe starting point for WordPress is 128M.
Note on PHP-FPM
On cPanel with PHP-FPM, each account has its own php.ini. You can adjust it from cPanel's MultiPHP INI Editor.
Step 4: Examine Script Permissions
Incorrect file permissions can stop scripts from executing. Your site files should be 644, folders 755. Directories like cgi-bin might need 755 for scripts. Run this fix (replace /home/user/public_html):
find /home/user/public_html -type f -exec chmod 644 {} \;
find /home/user/public_html -type d -exec chmod 755 {} \;
Also check ownership: files should be owned by the cPanel user, not root.
Step 5: Check for Plugin / Theme Conflicts (WordPress)
If your site runs WordPress, a faulty plugin or theme often causes 500. Temporarily disable all plugins by renaming the plugins folder:
cd ~/public_html/wp-content
mv plugins plugins_old
Then switch to a default theme (Twenty Twenty-Four) via WP-CLI or database update. If the site recovers, re-enable plugins one by one.
WP-CLI method:
wp plugin deactivate --all --allow-root
wp theme activate twentytwentyfour --allow-root
Step 6: Look for Server Resource Issues
A server out of disk space or memory can return a 500 before the script even runs. Check disk:
df -h
If a partition is 100%, free space by removing logs or temporary files. Also check memory:
free -m
If swap is full, you may need to restart Apache temporarily or contact your host.
Step 7: Set a Custom Error Page as a Temporary Measure
While debugging, a custom 500 page can at least give users a friendly message. Place this in your .htaccess:
ErrorDocument 500 /err500.html
Create a simple err500.html in public_html. But remember—this does not fix the underlying cause.
FAQ
Why does the 500 show a blank page sometimes? Apache returns a generic 500 without HTML when the error occurs before output buffering begins. The error log will have the details.
Can a faulty SSL certificate cause a 500?
Rarely, but a misconfigured SSL directive in Apache vhost can. Check error_log for SSL-related messages.
What if the error occurs only on certain pages? That usually points to a specific script or plugin. Follow the log line to the exact file.
Does Cloudflare affect 500 errors?
Cloudflare may show a generic 500 page if your origin returns 500. To see the real error, pause Cloudflare temporarily or use the cf-cache-status header.
What to check first
Start with the error log. Nine times out of ten, the log tells you exactly what's wrong. If you can't find the log, check .htaccess and PHP memory. These two steps resolve most 500 errors on cPanel. Save yourself time—don't guess; read the logs.
