Why Your Website Is Returning 500 Internal Server Error and How to Fix It
Summary
This guide helps you troubleshoot and resolve: Why Your Website Is Returning 500 Internal Server Error and How to Fix It. Follow the steps below to fix the issue.
Common Causes
A 500 Internal Server Error is a generic message indicating that something has gone wrong on the web server, but the server cannot specify exactly what the problem is. For small business owners, this means your website is live but unreachable, which can impact customer trust and sales. This guide will help you identify common causes and take steps to restore your site.
Warning: Before editing any website files, database settings, or configuration files, download a full backup of your website and database. Incorrect changes to core files can cause further downtime or data loss.
Quick Fix Steps
If your website is suddenly showing a 500 error, try these immediate actions before diving into deeper troubleshooting.
- Refresh your browser page to ensure the error is persistent and not a temporary glitch.
- Clear your browser cache or try accessing the site in an incognito or private browsing window.
- Check your social media or business pages to see if other customers are reporting the same issue.
- Determine if the error is isolated to one page or affects the entire website. If only one page is broken, the issue is likely isolated to that specific script or file.
- Wait a few minutes and refresh again; some server-side processes may resolve automatically.
Detailed Instructions
Check and Rename the .htaccess File
A corrupted .htaccess file is one of the most common causes of a 500 error. This file controls how your server handles requests.
- Log into your hosting control panel (e.g., cPanel).
- Open the File Manager application.
- Click Settings in the top-right corner of the File Manager.
- Check the box labelled Show Hidden Files (dotfiles) and click Save.
- Navigate to the root directory of your website (usually
public_htmlorwww). - Locate the file named
.htaccess. - Right-click the file and select Rename. Change the name to
.htaccess_oldand click Rename File. - Refresh your website in the browser. If the site loads, the
.htaccessfile was the cause. - Generate a new
.htaccessfile through your CMS settings (e.g., WordPress Permalinks) or contact your developer.
Warning: Always download a backup copy of your .htaccess file before renaming or deleting it to avoid losing custom redirects or security rules.
Increase PHP Memory Limit
If your website exceeds its allocated memory, the server may return a 500 error. This often happens after installing a new plugin or uploading large media files.
Warning: Editing wp-config.php carries risk. Incorrect syntax can prevent your website from loading entirely. Ensure you have a backup before proceeding.
- Access your site files via File Manager or an FTP client.
- Locate the
wp-config.phpfile (for WordPress) or yourphp.inifile. - Right-click the file and select Edit.
- Add or edit the following line to increase the memory limit:
define('WP_MEMORY_LIMIT', '256M'); - Click Save Changes and refresh your website.
Disable Conflicting Plugins or Themes
A faulty plugin or theme update can trigger a server error. If you can access your admin dashboard, deactivate plugins one by one. If you cannot access the dashboard, use the file manager.
- Open the File Manager and navigate to your content folder (e.g.,
/wp-content/plugins/). - Right-click the
pluginsfolder and select Rename. Change the name toplugins_disabled. - Refresh your site. If it works, rename the folder back to
pluginsand activate plugins individually to find the culprit.
Guidance for Non-WordPress and Custom Websites
If your website is not built on WordPress or another CMS, the steps above regarding wp-config.php and plugin folders do not apply. For custom-coded or static websites:
- Check your server-side scripts (e.g., PHP, Python, Node.js) for syntax errors or failed database connections.
- Review your web server configuration files (e.g.,
httpd.conf,nginx.conf, or application-specific.htaccessfiles) for syntax errors. - Ensure that any third-party libraries or frameworks are correctly installed and compatible with your server's PHP version.
- Verify that file and folder ownership matches the user account running the web server.
Troubleshooting
Analyse Server Error Logs
Server logs provide the specific reason for the 500 error, such as a syntax error in a script or a permission issue.
- Log into your hosting control panel.
- Look for a section labelled Metrics or Logs.
- Open Errors or Error Log.
- Look for entries that match the time you encountered the 500 error. Common entries include "Premature end of script headers" or "PHP Fatal error".
- Use the error message to search for a specific fix or provide it to your developer.
Check File and Folder Permissions
Incorrect permissions can prevent the server from reading essential files.
- Folders should typically be set to
755. - Files should typically be set to
644. - The
wp-config.phpfile should be more restrictive, usually600or640.
Note: Avoid setting permissions to 777 as this creates a significant security risk by allowing anyone to write to your files.
When to Contact Hosting Support
If none of the steps above resolve the issue, the problem may be related to server-level configuration, hardware failure, or a hosting environment issue that you cannot fix yourself.
Open a support ticket with your hosting provider and include the following details:
- The exact time and date the error started.
- Relevant entries from your server error logs.
- A list of troubleshooting steps you have already attempted.
- Whether the error affects the entire website or only specific pages.
If you host with us, you don't need to do this yourself — just Open a Ticket and our Brisbane team will get it sorted.
Still Having Issues?
💻 Open a Ticket