Managed technical services across Canada
Proudly Canadian

Guide

Fix 500 Internal Server Error on Your Website

A 500 error is usually caused by .htaccess, PHP errors, bad permissions, memory limits, or plugins. This guide shows how to isolate the cause quickly.

Editorial process: This article was created with AI assistance and prepared for publication by Gotekky.

Quick answer

What to check first

A 500 error is usually caused by .htaccess, PHP errors, bad permissions, memory limits, or plugins. This guide shows how to isolate the cause quickly.

The 500 Internal Server Error is one of the most unhelpful error messages a website can display. Unlike a 404, which tells you a specific page was not found, or a 503, which tells you the server is temporarily unavailable, a 500 error tells you only that something went wrong on the server. What went wrong, in which file, triggered by which request, is completely absent from what the browser shows. That information exists, but it is in your server logs rather than in the error page itself.

 

The good news is that 500 errors almost always have a specific, findable cause. Once you know how to read the right logs and where the most common causes hide, diagnosing and fixing a 500 error is usually a matter of minutes. This guide covers each major cause in order, starting with how to read the logs that tell you what actually happened.

 

Quick Summary

 

  • Read the PHP error log and Apache error log first: they contain the specific error message, file, and line number that caused the 500
  • A corrupted or invalid .htaccess file causes 500 errors across the entire site and is one of the fastest things to test
  • WordPress plugin and theme PHP errors are the most common cause on WordPress sites
  • Incorrect file permissions, particularly directories set to 777 or files set with wrong ownership, cause 500 errors on many server configurations
  • PHP memory limit errors produce 500 responses when a script exhausts the allocated memory before completing

 

Step 1: Read the Error Logs Before Changing Anything

 

Every other step in this guide involves making changes to your site or server configuration. Before doing any of that, spend two minutes reading your error logs. The logs almost always contain the exact cause, and knowing the cause before making changes means you fix the right thing rather than working through a checklist of possibilities.

 

In cPanel, navigate to the Metrics section and look for Error Log. This shows the Apache error log for your account, which records every server error including 500 responses. Look for entries timestamped around the time the error started. A PHP fatal error entry looks something like this:

 

[Wed Mar 20 14:22:05.123456 2026] [php:error] [pid 12345] [client 203.0.113.1:54321] PHP Fatal error: Uncaught Error: Call to undefined function some_function() in /home/username/public_html/wp-content/plugins/some-plugin/file.php on line 47

This single log entry tells you the error type (Fatal error), the function that does not exist (some_function), the exact file (/home/username/public_html/wp-content/plugins/some-plugin/file.php), and the line number (47). That is everything you need to identify the cause.

 

For WordPress sites, you can also enable WordPress's own debug log by adding these lines to wp-config.php before the line that says "That's all, stop editing!":

 

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

With these settings, WordPress writes detailed error information to a file at wp-content/debug.log rather than displaying it to visitors. After enabling this, reload the page that is showing the 500 error, then read the debug.log file via File Manager or FTP. The error will be logged there.

 

If the error logs are empty or do not show any recent entries despite the 500 error being active, PHP error logging may be disabled on your server. Contact your hosting provider and ask whether PHP error logging is enabled for your account, or open a support ticket and ask them to check the error logs at the server level.

 

Step 2: Check and Reset Your .htaccess File

 

A corrupted or invalid .htaccess file is one of the most common causes of 500 errors, and it is easy to test because disabling it takes one action. If .htaccess is the cause, the 500 error affects every page on your site rather than specific ones, because Apache reads .htaccess before processing any request.

 

In cPanel File Manager, navigate to the root of your public_html directory, enable Show Hidden Files so that .htaccess is visible, and rename the file to .htaccess.bak. This disables the file without deleting it. Reload your site. If the 500 error is gone, the problem was in .htaccess.

 

For WordPress sites, you can regenerate a clean .htaccess by deleting the current file entirely and then going to Settings, then Permalinks in the WordPress admin and clicking Save Changes without changing anything. WordPress will write a fresh .htaccess with only the permalink rules it needs.

 

If .htaccess was not the cause, restore the backup by renaming .htaccess.bak back to .htaccess before investigating further.

 

If you want to inspect the .htaccess content before disabling it, open it and look for recent additions. A plugin that adds rules to .htaccess or a recently pasted block of redirect rules that contains a syntax error will cause Apache to reject the file and return 500 for all requests. The error log will typically show an entry indicating that .htaccess has an invalid command or syntax error, which identifies the specific line to fix or remove.

 

Step 3: Identify PHP Errors from Plugins or Themes

 

On WordPress sites, PHP errors from plugins or themes are by far the most common cause of 500 errors. A plugin update that introduces a syntax error, calls a function from a different plugin that is not active, or uses a PHP function that was removed in the PHP version your server is running will cause a fatal error that results in a 500 response.

 

If you identified the problematic file from the error log in Step 1, go directly to that file and either deactivate the plugin it belongs to or revert to the previous version through File Manager.

 

If you cannot access the WordPress admin because the 500 error is site-wide, deactivate all plugins at the file system level. In cPanel File Manager, navigate to wp-content and rename the plugins directory to something like plugins-disabled. WordPress will see that the directory name no longer matches and will deactivate all plugins automatically. Reload your site. If the 500 error clears, a plugin is the cause. Rename the directory back to plugins, then deactivate them one at a time from the WordPress admin to find the specific offender.

 

If disabling all plugins does not resolve the error, the problem may be in the active theme. Rename the active theme's folder inside wp-content/themes to disable it. WordPress will fall back to a default theme. If this resolves the 500 error, the active theme contains a PHP error. Check for available updates for the theme or contact the theme developer.

 

Step 4: Check File and Directory Permissions

 

Incorrect file permissions prevent the web server from reading files it needs to execute, which produces 500 errors. The correct permissions for a cPanel-hosted WordPress site are 755 for directories and 644 for files. A common mistake, often introduced when someone tries to fix a permissions error by setting everything to 777, is the opposite problem on hardened server configurations: 777 directories are sometimes refused by the server's security settings and produce 500 errors rather than the more permissive access that was intended.

 

To check and fix permissions in cPanel File Manager, select the root public_html directory and look for a Change Permissions option. For bulk permission fixing on a WordPress site, the quickest approach via SSH is:

 

find /home/username/public_html -type d -exec chmod 755 {} \;
find /home/username/public_html -type f -exec chmod 644 {} \;

These two commands set all directories to 755 and all files to 644 recursively across your entire public_html directory. Replace username with your actual cPanel username.

 

After fixing permissions, reload your site and check whether the 500 error is resolved. If the error log was pointing to a specific file, verify that file's permissions individually in File Manager.

 

Step 5: Check the PHP Memory Limit

 

PHP scripts have a memory limit that defines the maximum amount of RAM a single script can consume before being terminated. When a script exceeds this limit, PHP terminates it and returns a fatal memory exhaustion error, which the web server translates into a 500 response for the visitor.

 

A PHP memory limit error in the error log looks like:

 

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /home/username/public_html/wp-includes/some-file.php on line 123


The number 134217728 bytes is 128 megabytes, which is a common default limit. The error means a script needed more memory than was available.

You can increase the PHP memory limit by adding a line to your wp-config.php file:

 

define('WP_MEMORY_LIMIT', '256M');

Alternatively, you can add the following to your .htaccess file:

 

php_value memory_limit 256M

Or create a php.ini file in the root of your public_html directory containing:

 

memory_limit = 256M

Increasing the memory limit resolves the immediate 500 error, but if the memory requirement is extremely high it may indicate a plugin or operation that is genuinely inefficient and worth investigating further. A WordPress site under normal operation should not require more than 256 megabytes for standard requests.

 

Step 6: Check for Corrupted WordPress Core Files

 

WordPress core files that have been modified, partially overwritten during a failed update, or corrupted by a disk error can produce 500 errors. This is less common than plugin or theme errors but worth checking if the other steps have not resolved the issue.

 

The most reliable way to rule this out is to reinstall WordPress core files without overwriting your wp-config.php, your wp-content directory, or your database. From the WordPress admin, go to Dashboard, then Updates, and click Reinstall Now. This downloads a fresh copy of the WordPress core files and replaces them without affecting your content or configuration.

 

If you cannot access the WordPress admin, you can manually replace core files by downloading the correct version of WordPress from wordpress.org, extracting it, and uploading all files except wp-config.php and the wp-content directory to your public_html via FTP or cPanel File Manager.

 

Step 7: Check the PHP Version

 

If the 500 error started after a hosting provider changed your server's PHP version, or if you recently changed it yourself in cPanel's Select PHP Version tool, incompatibilities between your PHP version and your plugins or themes may be the cause. Many PHP functions were deprecated or removed between major PHP versions. A plugin written for PHP 7.4 may produce fatal errors when run on PHP 8.1 or 8.2 if the developer has not updated it for the newer version.

 

In cPanel, look for the Select PHP Version option under Software. If you recently changed the PHP version, try reverting to the previous version. If a specific plugin is logging compatibility errors in your error log, check the plugin's changelog or support forum for information about PHP version compatibility.

 

Diagnosing 500 Errors That Only Affect Specific Pages

 

If the 500 error appears on specific pages but not others, the cause is more likely in the content, template, or plugin functionality specific to those pages rather than a server-wide configuration problem. This narrows the investigation considerably.

 

Check whether the affected pages have anything in common: the same page template, a specific shortcode, a particular plugin's output, or a custom field value. The error log will show the specific file and line causing the error on those requests. If a particular shortcode is causing the error, the plugin that handles that shortcode is the source. If a custom page template is involved, the template file contains a PHP error.

 

For WooCommerce sites, 500 errors that only affect the cart or checkout are often caused by a WooCommerce extension with a PHP error or by a conflict between WooCommerce and another plugin. Temporarily switching to the Storefront theme and deactivating all WooCommerce extensions except core WooCommerce will help isolate the conflict.

 

Managing This Through WHMCS

 

If your hosting is managed through our client portal, you can access cPanel directly from your WHMCS account via the single sign-on link in your service details. From cPanel you can read error logs, access File Manager to check .htaccess and permissions, and change your PHP version.

 

If you have checked the error logs and the 500 error persists without a clear cause, or if the error log is empty despite the error being active, open a support ticket from your WHMCS client area with your domain name, the time the error started, and any recent changes you made to your site. Our team can review server-level logs and configuration to identify causes that are not visible from within cPanel alone.

Gotekky

Need help deciding what to do next?

Tell us what you are seeing and what outcome you need. We will identify whether a managed service, scoped project or paid technical assessment is the right next step.