How to Fix the ‘500 Internal Server Error’ in WordPress?

If you have been facing a ‘500 Internal Server Error' in your WordPress website, then this article will be helpful to you. The '500 Internal server error' is not WordPress-specific, and it can happen with any website you host with any web server. There are several reasons why this error can occur. 

Its generic nature makes it annoying to fix since it won't show the actual error in the browser, making the rectification difficult.

To send the actual errors to browsers for the Windows-based servers, you will have to log in to the Web server and browse the WordPress website from the server itself. 

To check actual errors in Linux-based servers, you will have to dig the server logs for the exact cause of the 500 errors. 

We have compiled all possible causes of the ‘500 Internal Server Error' in WordPress along with troubleshooting steps.

500 Internal Server Error in WordPress

 

Cause 1: Corrupt .htaccess File

If your .htaccess file is corrupt, it can cause a ‘500 Internal Server Error'. In this case, first, you will have to access the .htaccess file either through FTP or through the cPanel file manager and rename it. Here are the steps you can refer to rename the .htaccess file –

  1. After logging in to cPanel, select the File Manager icon under the Files section.
  2. Check the box for Document Root and select the domain name you wish to access from the drop-down menu.
  3. Make sure 'Show Hidden Files (dotfiles)' is checked, and click on Go.
  4. In a new tab, File Manager will open. 
  5. Locate the .htaccess file in the list of all files.
  6. Right-click on the .htaccess file and rename it to .htaccess.older.

Create new .htaccess

  1. Log in to the WordPress dashboard.
  2. From the left-hand navigation menu, click on Settings > Permalinks
  3. Click the Save Settings button and try reloading your website.
  4.  If renaming the .htaccess file does not resolve your problem, continue reading this article.

Cause 2: Memory Exhausted

This error also occurs if your WordPress website exhausts the memory limit. It could be a poorly coded plugin or a theme that is exhausting your memory limit. To fix this, you will have to increase the memory limit in WordPress. 

  • Open the wp-config.php file located under the root WordPress directory. 
  • Add the following line in wp-config.php  

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

  • Save the file.
  • If you still get this error after this fix, you will have to extend the PHP Memory limit from the php.ini file

You can contact your web host to increase the PHP memory limit.

Cause 3: Culprit Plugins

If increasing the PHP memory limit does not fix your ‘500 Internal Server Error', it is more likely caused by one or more plugins installed on WordPress. It is quite often that when a new plugin is installed, the previously installed plugins are not compatible with it, resulting in a ‘500 Internal Server Error'. In other cases, a combination of certain plugins or themes is not compatible with each other and hence ends in this error.

Unfortunately, there is no straightforward way we can determine the exact problematic plugin. Hence, you must deactivate all the WordPress plugins to filter down plugin-specific issues. 

Refer to the following steps to deactivate all WordPress plugins without a WordPress dashboard –

Deactivate all plugins through cPanel

  1. Log in to cPanel
  2. Under the Files section, go to File Manager.
  3. Select Web Root (public_html/www) and click Go.
  4. Expand the public_html folder, and navigate to the /wp-content/plugins folder.
  5. Right-click on the /wp-content/plugins folder and rename it to plugins.old.
    This will deactivate all of the plugins at once.
  6. Now, reactivate the plugins folder again by renaming it back to plugins.
    This will allow you to access the WordPress dashboard again.
  7. In the WordPress Dashboard, reactivate each plugin (one at a time) and reload your website to see if the ‘500 Internal Server Error' is fixed.

Deactivate all plugins through phpMyAdmin

  1. Login to phpMyAdmin and locate table wp_options
  2. Under the option_name column (field), find the active_plugins row
  3. Change the option_value field to: a:0:{}

This method can determine the offending plugin and isolate it to resolve the ‘500 Internal Server Error'.

Re-uploading Core Files

If disabling the plugin does not fix the ‘500 Internal Server Error', then the only option you are left with is to re-uploading the wp-admin and wp-includes folder from a fresh WordPress install. 

  • Download fresh WordPress installation, locate wp-admin and wp-includes folders, and replace them at the web server. 
  • It won't remove any of your WordPress data, but it will fix any file corruption issues.

Contact your Web Host to Check Server Logs

You should contact your web host if no above-listed solution works for you. Web hosts can check the web server error logs and determine the exact cause of the ‘500 Internal Server Error'

If you faced the ‘500 Internal Server Error', let us know how you fixed it by dropping an email at support@accuwebhosting.com.


Was this answer helpful?

« Back

chat