Error 500 - Internal Server Error

Errors & Troubleshooting | Updated March 2026

A 500 Internal Server Error means something went wrong on the server while processing your request, but the server can't tell you exactly what. It's the most generic error in HTTP, which makes it frustrating to debug. On our hosting platform, 500 errors are almost always caused by .htaccess syntax errors, PHP errors, file permission problems, or resource limits. This guide walks through each cause with the specific fix.

01. Check the Error Log First

Before trying any fixes, look at the error log. In cPanel, go to Metrics > Errors. The most recent entries will tell you exactly what's failing. Common messages you'll see:

  • Invalid command 'xyz' - .htaccess syntax error (see Section 2)
  • PHP Fatal error: ... - PHP code problem (see Section 3)
  • SoftException in Application.cpp - file ownership/permission issue (see Section 4)
  • mod_fcgid: can't apply process slot - resource limit (see Section 5)
  • Premature end of script headers - PHP crash or timeout (see Section 3)
Tip

If you can't access cPanel (rare, but possible if the 500 affects the entire account), connect via FTP or SSH and check ~/logs/error.log directly. Our FTP guide covers how to connect.

02. Bad .htaccess File

This is the #1 cause of 500 errors on shared hosting. A single typo or unsupported directive in .htaccess triggers a 500 for every page on the site.

How to Diagnose

The error log will show something like:

/home/username/public_html/.htaccess: Invalid command 'RewriteEgine', 
perhaps misspelled or defined by a module not included in the server configuration

How to Fix

  1. Rename .htaccess temporarily - in File Manager or via FTP, rename .htaccess to .htaccess_backup. If the site loads, the problem is in that file
  2. Find the bad line - open the file and look for the line mentioned in the error log. Common mistakes: misspelled directives, missing <IfModule> wrappers, or directives from a different server type (nginx rules in Apache .htaccess)
  3. Fix and restore - correct the error, rename the file back to .htaccess, and test
Warning

If you're using WordPress and rename .htaccess, your permalinks will break (pages return 404 except the homepage). That's expected. Once you fix and restore .htaccess, permalinks work again. If the original .htaccess was lost, go to WordPress Settings > Permalinks and click "Save Changes" to regenerate it.

For a deeper understanding of .htaccess syntax and directives, see our Complete .htaccess Guide.

03. PHP Errors

PHP fatal errors cause 500s because the script can't complete and the server has nothing to send back to the browser.

Common PHP Error Messages

  • "Allowed memory size exhausted" - the script tried to use more memory than allowed. Increase memory_limit in cPanel > Select PHP Version > Options. Our default is 384MB, but some plugins need more
  • "Maximum execution time exceeded" - the script ran longer than the timeout. Increase max_execution_time in the same location
  • "Call to undefined function xyz()" - a required PHP extension is missing. Check which extension provides the function and enable it in Select PHP Version. Common ones: mysqli, gd, mbstring, curl
  • "Parse error: syntax error" - a PHP file has a coding error. The log tells you the exact file and line number. If it's in a plugin, update or deactivate the plugin

Enable Error Display (Temporarily)

If the error log isn't helpful, you can temporarily make PHP display errors on-screen:

# Add to .htaccess (temporary - remove after debugging)
php_flag display_errors on
php_value error_reporting E_ALL
Warning

Never leave display_errors on in production. It exposes file paths and potentially sensitive information to visitors. Use it only for debugging, then remove it.

PHP Version Incompatibility

If the 500 started right after a PHP version change, the code may use features not available in the new version (or removed from it). Switch back to the version that was working in cPanel > Select PHP Version. See our PHP Version Guide.

04. File Permission Problems

CloudLinux and suPHP require specific file ownership and permissions. If files are owned by the wrong user or have overly permissive settings, the server refuses to execute them and returns a 500.

Correct Permissions

  • Directories - 755
  • Files - 644
  • .htaccess - 644
  • wp-config.php - 640 or 644

Fix Permissions

In cPanel Terminal or SSH:

# Fix all directory permissions
find ~/public_html -type d -exec chmod 755 {} \;

# Fix all file permissions
find ~/public_html -type f -exec chmod 644 {} \;

Ownership Issues

If the error log shows SoftException in Application.cpp: Mismatch between target UID, the files are owned by the wrong user. This can happen after restoring a backup or running a script as root. Contact support to fix ownership - it requires server-level access.

05. Resource Limits

Sometimes a 500 error is actually a resource limit in disguise. When your account hits its CloudLinux limits, the server may return 500 instead of the more descriptive 508. Check cPanel > Resource Usage to see if CPU, memory, or Entry Processes spiked at the time of the error.

For full details on diagnosing and fixing resource limit issues, see our Resource Limit Guide.

06. WordPress-Specific 500 Errors

Bad Plugin

If the 500 started after installing or updating a plugin:

  1. Rename the plugins folder - via FTP or File Manager, rename wp-content/plugins to wp-content/plugins_off
  2. Load the site - if it works, a plugin is the cause
  3. Rename it back - then rename individual plugin folders one at a time until you find the offender

Bad Theme

Same approach: rename wp-content/themes/your-active-theme and WordPress will fall back to a default theme. If the site loads, the theme has an error.

Corrupted Core Files

If neither plugins nor themes are the cause, WordPress core files may be corrupted. Re-download WordPress from wordpress.org and upload the wp-admin and wp-includes directories to overwrite the existing ones. Don't overwrite wp-content (that's your data) or wp-config.php (that's your settings).

Database Connection Issues

If wp-config.php has wrong database credentials, WordPress sometimes shows a 500 instead of the "Error establishing a database connection" message. Verify your DB_NAME, DB_USER, and DB_PASSWORD in wp-config.php match what's in cPanel > MySQL Databases.

07. Other Causes

CGI Script Errors

If you're running CGI/Perl scripts, they must have 755 permissions, Unix-style line endings (not Windows \r\n), and the correct path to the Perl interpreter on the first line (#!/usr/bin/perl).

ModSecurity Blocking

Our ModSecurity WAF can block requests it considers suspicious, returning a 500 or 403. The error log will mention ModSecurity if this is the cause. If a legitimate request is being blocked, contact support with the URL and error log entry and we can add an exception.

SSL Certificate Issues

In rare cases, a misconfigured SSL redirect loop can manifest as a 500. If the error only happens on HTTPS, check your .htaccess for redirect rules and ensure they're not creating a loop. See our SSL/Mixed Content guide.

Still Seeing 500 Errors?

If you've checked the error log and tried the fixes above without success, open a support ticket with the error log entries. This helps us diagnose server-side issues that aren't visible from cPanel.

Open a Support Ticket

Quick Recap: Fix 500 Errors

If you only do 5 things from this guide, do these:

  1. Check the error log - cPanel > Errors tells you the actual cause
  2. Test .htaccess - rename it to rule out syntax errors
  3. Check file permissions - directories 755, files 644
  4. Disable plugins/themes - rename folders to isolate the problem (WordPress)
  5. Check Resource Usage - a 500 might actually be a resource limit

Last updated March 2026 · Browse all Troubleshooting articles

  • 467 Users Found This Useful

Was this answer helpful?

Related Articles

central_filter defer (-17): error in filter file: unknown filtering command r_subject: near line 22 of filter file

The error "central_filter defer (-17): error in filter file: unknown filtering command r_subject:...

Account's error_log produces flood of missing modules

 Account's error_log produces flood of missing modules. Ex:   From error_log:     [23-Apr-2018...

Error: SoftException in Application(dot)cpp:303 UID of script is small than min_uid

The error message "Error: SoftException in Application(dot)cpp:303 UID of script is small than...

Unable to Include Potential Exe - ModSecurity Error

Errors & Troubleshooting | Updated March 2026 The error "Unable to include potential exe"...



Save 30% on web hosting - Use coupon code Hosting30