Fix 500 Internal Server Error in WordPress

 


An Internal Server Error 500 is one of the most troublesome errors one can see on a website because these errors won’t provide much information to resolve them easily. We will also see these kinds of errors in WordPress websites without detailed information on why this 500 Internal Server Error occurred. Don’t worry, I’ll walk you through a couple of simple steps to fix this in WordPress.

First of all, you should take a backup of your WordPress website before continuing. You can restore your website from earlier backups and then you can work on fixing the issue with your new backup.

These steps will help you resolve a 500 Internal Server Error on your WordPress website. Make sure you follow each step.

1. Problem with htaccess file

The htaccess file is the first common cause of 500 Internal Server Errors. There is an easy fix for this htaccess error in WordPress.

Log in to your hosting account using cPanel or FileZilla. .htaccess files are located in the root directory of your WordPress installation, most likely under public_html. The hidden files feature is enabled from the settings if you cannot see this file. Change the name of the file to something other than .htaccess, such as .htaccess_bak. Your website should now be accessible without any 500 Internal Server errors.

The next step is to create the .htaccess file for the WordPress URLs to work. It isn’t necessary to type all the code to create this file manually. This file can be created by clicking a button.

Log into the WordPress admin area, go to Settings => Permalinks, and click on the save button. The new .htaccess file should be created, and all URLs should work normally.

2. Due to Insufficient PHP Memory Limit

The 500 Internal Server Error in WordPress can sometimes be caused by insufficient PHP memory.

The PHP Memory Limit is causing the Internal Server Error. While performing some actions on your WordPress website, you will receive this Internal Server Error.

From both cPanel and WordPress, you can increase the PHP Memory Limit. Log in to cPanel and open the File Manager. Create a new php.ini file in the root directory or public_html directory and add memory=64MB, then save the file.

Open the wp-config.php file in WordPress and add the following code

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

3. Caused by a WordPress Plugin

WordPress Plugins may be the cause of Internal Server errors on your site. Check it out by renaming the plugins directory to something like “plugins-deactivated”.

The issue is caused by one of the plugins if you can access the website after making the above changes.

Try enabling and disabling plugins one by one, so you can find the plugins that are causing the problem. Plugins that are outdated will most likely cause these problems.

4. Dubugging WordPress Installation

You can enable debugging in WordPress to log the errors to debug.log file under the wp-content directory.

To enable debugging in WordPress, open wp-config.php file and add these lines of code.

define (‘WP_DEBUG’, true);
define (‘WP_DEBUG_LOG’, true);
define (‘WP_DEBUG_DISPLAY’. false);
@ini_set (‘display_errors’, 0);

After adding the code, reload the page which is causing the internal server error. Now if you check wp-content directory, you should see the debug.log file.

5. Check File Permissions

If you have not been able to solve the Internal Server Error issue after following the above steps, check the permissions of the folders and files. Permissions for Folders & Files should be 755 or 644, anything else may cause the issue. Using FTP programs like Filezilla or cPanel, change the permissions for these numbers.

6. Maybe Corrupted WordPress Core Files

It’s possible that the WordPress core files are corrupted if the above steps have not resolved your problems.

Visit the WordPress website and download the latest version of WordPress. Extract these files and upload wp-admin and wp-includes folders to the server.

If your issue has been resolved by now, reload the website.

Conclusion

WordPress 500 Internal Server Errors are one of the most challenging issues because we do not know what’s causing it.

You should be able to resolve your website issue after following the above steps. If not, contact your hosting provider. You may be able to fix this problem with their help.

Always take daily backups automatically if you don’t want to get into trouble in the future. WordPress has a number of free backup plugins.

*

Post a Comment (0)
Previous Post Next Post