Skip to main content

How to Troubleshoot a 500 Internal Server Error on a Website

A 500 Internal Server Error is a generic "catch-all" error indicating that the server encountered an unexpected condition that prevented it from fulfilling a request. This error occurs on the website's server and is typically caused by a misconfigured...

A 500 Internal Server Error is a generic "catch-all" error indicating that the server encountered an unexpected condition that prevented it from fulfilling a request. This error occurs on the website's server and is typically caused by a misconfigured script, a corrupted file, or an exhausted server resource.

Before you begin

You will need:

  • Access to your website's hosting control panel (such as cPanel or Windows Control Panel).

  • Access to the website's file manager or an FTP client.

  • The ability to identify the specific URL where the error occurs.

Check the error logs

Because a 500 Internal Server Error is a general message, the most accurate information regarding the cause is located in the server's error logs.

  1. Log in to your hosting control panel.

  2. Locate the Errors or Logs section.

  3. Find the Apache Error Log or Web Server Error Log.

  4. Search for the most recent entries corresponding to the time you encountered the 500 error.

  5. Identify the specific file path and line number mentioned in the error.

Note: If you are using a CMS like WordPress, the site may also generate a specific debug.log file within the application's directory.

Identify the cause from the logs

Once you have accessed the logs, look for the following common indicators:

  • File Path Errors: If the log points to a specific plugin or theme folder, that component is likely causing the conflict.

  • Permission Errors: Look for "Permission denied" or "Could not open" messages. Files should typically have 644 permissions and folders should have 755 permissions.

  • Memory Limit Errors: Look for "Allowed memory size exhausted" or "Memory limit exceeded."

  • Timeout Errors: Look for "Maximum execution time exceeded" or "Timeout" messages.

Common fixes based on log results

Depending on what you find in the logs, perform the following actions:

If a plugin or theme is identified

  1. Access your site's files via a File Manager or FTP.

  2. Navigate to the directory for the specific plugin or theme.

  3. Rename the folder (e.g., change plugin-name to plugin-name_old). This will force the system to deactivate the component.

  4. Refresh your website to see if the 500 error is resolved.

If a permission error is identified

  1. Navigate to the directory of the file or folder mentioned in the error log.

  2. Update the permissions to the standard values (e.g., 755 for folders and 644 for files).

  3. Refresh the page.

If a resource limit is exceeded

  1. Log in to your control panel.

  2. Locate the Select PHP Version or PHP Selector tool.

  3. Select Edit or Select PHP Settings.

  4. Increase the memory_limit or max_execution_time to a higher value.

  5. Save the changes.

Confirm the result

  • The website loads successfully at the URL where the 500 error was previously visible.

  • The error logs no longer show new 500-related entries for that specific page.

If the error persists after checking logs

If the error remains and the logs do not provide a clear path to a solution, the issue may involve a server-level configuration or a complex script conflict.

  1. Collect the following information:

    • The specific URL where the error occurs.

    • A copy of the latest entries from your server's error logs.

    • A description of any recent changes (e.g., installing a new plugin, updating a theme, or changing a configuration file).

  2. Contact Hostek support with these details so we can investigate the server environment.

Did this answer your question?