Troubleshooting 500 Internal Server Error
Troubleshooting 500 Internal Server Error
The 500 Internal Server Error is a generic HTTP status code indicating that something went wrong on the server but the server couldn’t be more specific about the problem. Here are the most common causes and how to fix them.
Common Causes and Solutions
1. Corrupted or Incorrect .htaccess File
The .htaccess file is the most frequent cause of 500 errors.
Fix:
- Access your files via cPanel File Manager or FTP.
- Navigate to
public_html. - Rename
.htaccessto.htaccess_backup. - Check if the error is resolved.
- If yes, create a new
.htaccesswith basic rules or fix the syntax error in the old file.
Default WordPress .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
2. PHP Errors
Syntax errors, unsupported functions, or incompatible PHP versions can cause 500 errors.
Fix:
- Check the error log: In cPanel, go to Metrics > Errors or check
error_login yourpublic_htmldirectory. - Update PHP version: Go to Software > Select PHP Version and try a newer or older compatible version.
- Increase PHP memory limit: Add to
.htaccess:Or inphp_value memory_limit 256Mphp.ini:memory_limit = 256M
3. Incorrect File Permissions
Files and directories with wrong permissions can trigger 500 errors.
Fix:
- Directories should be set to 755:
chmod 755 directory_name - Files should be set to 644:
chmod 644 filename .htaccessshould be 644- Never set permissions to 777 — this is a security risk and can cause 500 errors on some servers.
4. Faulty Plugins or Themes (WordPress)
A recently installed or updated plugin or theme may be incompatible.
Fix:
- Access your site files via FTP or File Manager.
- Navigate to
wp-content/plugins/. - Rename the
pluginsfolder toplugins_disabled. - Check if the site loads. If yes, rename it back and deactivate plugins one by one to find the culprit.
- For themes, rename the active theme folder in
wp-content/themes/to force WordPress to use a default theme.
5. Resource Limits Exceeded
On shared hosting, exceeding CPU, memory, or process limits can cause 500 errors.
Fix:
- Optimize your website by enabling caching, optimizing images, and reducing database queries.
- Check resource usage in cPanel under Metrics > Resource Usage (if available).
- Upgrade your hosting plan if you consistently hit limits.
6. CGI/Perl Script Errors
If you’re running CGI or Perl scripts:
- Ensure scripts have 755 permissions
- Use the correct shebang line:
#!/usr/bin/perl - Upload scripts in ASCII mode (not binary) via FTP
- Check for syntax errors
How to Check Error Logs
The error log is your best tool for diagnosing 500 errors:
- In cPanel, go to Metrics > Errors for a quick view.
- Check
error_logfile in yourpublic_htmlor relevant directory. - Via SSH:
tail -50 /home/username/public_html/error_log
Need Help?
If you’ve tried all the above and still see the error, contact 10Corp support with the relevant error log entries. Our team can help diagnose server-side issues.