500 Internal Server Error: Causes and Fixes

Category: Errors & Troubleshooting ยท Updated 2026-10-30

A 500 Internal Server Error is an HTTP status code meaning the web server ran into an unexpected condition and could not fulfill the request. It is a server-side problem, and the fastest way to find the cause is to read the server error log.

What a 500 error means

HTTP status codes in the 5xx range signal that the server failed. A 500 is the generic version: the server knows something went wrong but the error does not map to a more specific code. Browsers may display it as "500 Internal Server Error", "HTTP ERROR 500", "Error 500" or "This page isn't working".

Because the message is deliberately vague, the real reason is only visible in the server logs.

Common causes

  • A PHP error or fatal exception in your code, a plugin or a theme.
  • A syntax error in .htaccess, such as an invalid directive or a module that is not installed.
  • Wrong file or folder permissions. A typical safe setup is 644 for files and 755 for directories.
  • PHP memory limit reached, or a script that runs longer than the maximum execution time.
  • A plugin or theme conflict, often right after an update.
  • A corrupted WordPress core file or a broken database connection.
  • An incompatible PHP version, for example code written for PHP 7 running on PHP 8.
  • Resource limits on the account, such as too many simultaneous processes on shared hosting.

How to fix a 500 error step by step

  1. Reload the page. Some 500 errors are brief and clear on their own.
  2. Read the error log. In cPanel open Metrics, then Errors, or look at the error_log file in the site folder. On a VPS check /var/log/apache2/error.log or /var/log/nginx/error.log. The last lines usually name the file and line that failed.
  3. Test .htaccess. Rename it to .htaccess-old and reload. If the site works, the file was the cause; rebuild it step by step.
  4. Check permissions. Set files to 644 and directories to 755, and make sure the owner is your account user.
  5. Raise the PHP memory limit, for example memory_limit = 256M in your PHP settings, if the log mentions "Allowed memory size exhausted".
  6. Check the PHP version. Switch to the version your application supports.
  7. Disable plugins and themes. In WordPress, rename the wp-content/plugins folder to plugins-off, then restore plugins one at a time to find the culprit.
  8. Contact your host if the log shows resource limits or server-level errors you cannot change.

Fixing a 500 error in WordPress

Turn on debug logging by adding these lines to wp-config.php:

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

Errors are then written to wp-content/debug.log. Look for the plugin or theme path in the last entries. If you cannot tell, switch to a default theme by renaming your active theme folder, and re-save permalinks afterwards to regenerate the rewrite rules. Turn debugging off when you are done.

500 vs. other 5xx errors

CodeNameTypical meaning
500Internal Server ErrorGeneric failure while handling the request
502Bad GatewayA proxy or gateway got an invalid response from an upstream server
503Service UnavailableThe server is overloaded or in maintenance and cannot respond right now
504Gateway TimeoutAn upstream server did not answer in time

Frequently asked questions

What causes a 500 Internal Server Error?

The most common causes are a PHP error in a script, plugin or theme, a faulty .htaccess file, incorrect file permissions, an exhausted PHP memory limit and incompatible PHP versions. The server error log will show which one applies.

Is a 500 error my fault as a visitor?

No. A 500 error comes from the website's server, not from your device or connection. You can reload the page or try again later, but only the site owner or host can fix the underlying problem.

How do I fix a 500 error in WordPress?

Enable WP_DEBUG_LOG and read wp-content/debug.log, rename the plugins folder to deactivate all plugins, switch to a default theme, rename .htaccess to let WordPress regenerate it, and raise the PHP memory limit. Restore items one at a time to find the one that causes the error.

Does a 500 error hurt SEO?

A short outage is normally harmless, because search engines retry later. If the error persists for days, crawlers reduce how often they visit and may drop affected URLs from the index until the pages work again. Fix it quickly and check Google Search Console for crawl errors.

What is the difference between a 500 and a 503 error?

A 500 means the server hit an unexpected failure it cannot describe more specifically. A 503 means the server is temporarily unable to handle requests, usually because of overload or maintenance, and it often includes a Retry-After header.

Where can I find the error log for my website?

On cPanel hosting, open Metrics then Errors, or check the error_log file in your site's directory. On a VPS with Apache the log is typically /var/log/apache2/error.log, and with Nginx it is /var/log/nginx/error.log.

What file permissions should I use to avoid a 500 error?

Use 644 for files and 755 for directories in most hosting setups. Permissions such as 777 can trigger errors on servers with suPHP or similar protections, and they are also a security risk.

Related topics