500 internal server error in WordPress

Are you getting 500 internal server error in WordPress? Internal server error is most common WordPress error. This error doesn’t give any particular information, many users find it quite frustrating. This can cause a sudden drop in website traffic and it may also affect the user experience of a website. Here in this article I will show several solutions to this problem how to fix 500 internal server error.

Before fixing this issue I strongly recommend you to take complete backup of your website files and database associated with it, in case something goes wrong while fixing the issue you can use the backup to restore.

internal-server-error

What is 500 internal server error?

This error occurs on the server level whenever the server encounters an unexpected condition it will not show the requested page. It may be difficult to rectify this error because it can cause due to many different issues. It’s tough to find the solution, we have to troubleshoot to get it fixed, it can take more your time to resolve the issue.

Most common Solutions for the 500 Internal Server Error

  1. Fixing corrupted .htaccess file
  2. Increasing the PHP Memory Limit
  3. Deactivating plugins to find the faulty plugins. (Locating issues by debugging your site.)
  4. Uploading fresh wp-content and wp-includes folders to your site.
  5. Contacting Host Support Team
  1. Fixing corrupted .htaccess file

Login into root folder (public_html) of your WordPress website by Cpanel or by using FileZilla FTP where you see folders named wp-includes, wp-admin and more files listed over there. Check for the .htaccess file, right-click it and rename it. “.htaccess.old”. Please check the below screenshot for your reference

htaccess-old

Now create a new .htaccess file,then login into your dashboard  by using admin details. Click on Settings in the left side bar goto Permalinks at the bottom of the page click on Save Changes. Now open your website and check whether the error has been fixed or not. If it is fixed then no need to do anything. If you are still seeing the issue then you have to troubleshoot with other options.

  1. Deactivating plugins to find the faulty plugins.

Internal server errors 500 sometimes causes by plugin or theme function conflicts, so if you have access to your Dashboard, then login with it, deactivate all the installed plugins. If you’re unable to access admin panel then you have to deactivate all WordPress plugins at once by renaming the plugins folder, it will be in your root folder under wp-content. If you are unable to locate you can simply search with term “Plugins” in cpanel dashboard there you will find the exact location. Now rename the folder to deactivate all the plugins at once.

deactivating-plugins

If that resolves the issue, log into admin area and reactivate each plugin one by one, refresh your website after each plugin activation until you find the issue. If you found that plugin which causes error remove it and try for alternate one. Otherwise try to troubleshoot it by increasing PHP Memory limit.

  1. Increasing the PHP Memory Limit

Most common ways to increase PHP memory limits of your WordPress website is by modifying the code in one of these below files:

  • wp-config.php file
  • php file
  • .htaccess file
  • ini file

Modifying wp-config.php file

You can increase the PHP memory limit by opening the root directory(public_html), locate your wp-config.php file. Right-click and Download the file. Open the file in text editor, and add the below code under the PHP tag

define(‘WP_MEMORY_LIMIT’, ‘256M’);

Please check the below screenshot for your reference

 wp-config

Modifying functions.php file

In root directory search for function.php file. Right-click and download it. Open the file in text editor and add the below code under the PHP tag

 functions

Modifying .htaccess file

You can also increase PHP memory limit by modifying a .htaccess file. In root directory search for .htaccess file. Right-click and download it. Open the file in text editor and add the below code under the PHP tag

htaccess-php

Modifying php.ini file

For this you have to create a php.ini file and add the below code in it. Now upload the file in the wp-admin folder.

php.ini

Replace fresh copy wp-content and wp-includes folders into your website.

WordPress site consists of third party plugins & themes, auditing their source code is difficult than one expected inorder to resolve the issue. For this you need to download new copy of wordpress from wordpress.org. Copy the wp-admin & wp-content folders and upload to live host via through Cpanel or FTP. Refresh the website and check whether it was resolved or not.

  1. Contacting Host Support Team

If the issue is still exists even after the possible troubleshoots, then you should contact your hosting provider support team. You can submit a ticket to the technical experts they can resolve the issue by modifying the server settings.

I hope this article was helpful. If you have any questions drop an email at info@wptechportal.com