How to Fix HTTP Error 500 WordPress?

How to Fix HTTP Error 500 WordPress?

Wordpress 500 Internal Server Error

HTTP error WordPress almost runs on most of the pages of your site, if there is a problem with the webserver or with the file system that powers the website. As a result, the server becomes unable to show the requested web page and the error pops up. 

Another factor that triggers this error might be the root directory where the WordPress files are located. Sometimes, problems with the host’s server can also lead to this situation.

Therefore, fixing this error is necessary as it might lead to a traffic loss as well as it can also affect the user experience of your website. However, if you are unaware of the solutions to this error, take an overview of the solutions that are stated below.

Effective Solutions to Fix WordPress Internal Server Error:

WordPress is no exception when the concern is an error. There are a number of issues that might trigger up. However, WordPress internal server error is the most frustrating one. There are plenty of solutions to troubleshoot this error. Some of them are described below.

These solutions might require to make a huge change in the root directory of your website. So, before applying the below solutions, it is necessary to create a backup of your website which will help you to save the data in case anything goes wrong. 

After creating a backup of your WordPress website, perform the following fixes: 

Fix 1: Check the Permissions of the File

This is likely not the problem, but still, you need to check it. Permissions for the files and folders should be 644 or 755 in the WordPress directory. Setting permissions to anything else might create several problems including the HTTP error 500 WordPress

Check the Permissions of the File

To do this, open the root directory of any FTP client. Most of the clients have a Permissions tab that can be used to check the permissions for each folder and files in the root directory. So, ensure that these permissions are not set to anything other than 644 or 755 from here. 

In case you notice that there are no problems with the file permissions, then you can move on to the other ways discussed below. 

Fix 2: Create a New .htaccess File

Create a New .htaccess File

The .htaccess file is a key file of any PHP based application. It contains commands related to server configuration. So, if this file is corrupted, then it might lead to this error. 

Mostly, it occurs when this file is affected by a module or a broken installation of a theme. In this case, first, you will have to access the .htaccess file. Here’s how to do this: 

Step 1: 

In the beginning, log into your FTP account. After logging into the FTP account, you will notice a .htaccess file is available there in the root directory along with the other folders like wp-admin, wp-content, and wp-include. 

Step 2: 

After finding the .htaccess file, you have to download it from the live server to a local location on the computer. After that, open the file by using a text editor (Dreamweaver, Notepad++, or others). 

Step 3: 

Next, visit the official website of WordPress and enter the code version that suits your website. Now, save the .htaccess file and then upload it to your live server. 

The code might differ depending on the installation and configurations of the WordPress website. In case you are using WordPress Multisite in WordPress 3.5 or any later version than it, then you can use the below codes: 

1st: RewriteEngine On

2nd: RewriteBase /

3rd: RewriteRule ^index\.php$ – [L]

4th: # add a trailing slash to /wp-admin

5th: RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

6th: RewriteRule ^ – [L]

7th: RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]

8th: RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]

9th: RewriteRule . index.php [L]

After doing this, reload the website to check if the HTTP error 500 WordPress is fixed or not. Otherwise, you can try the other ways described below. 

Fix 3: Increase the PHP Memory Limit of WordPress

Increase PHP Memory Limit

When a user makes a request for a webpage on any website, it is managed by PHP and triggers a process that ultimately renders the HTML from the end of the client. PHP memory is responsible for running this process. 

Usually, your WordPress and host set this memory as default. So, when there is a memory drop, the server displays this error automatically. Therefore, you can easily avoid the HTTP error 500 WordPress by increasing the memory limit. 

To do this, you will have to alter the code in any one of the below files: 

  • .htaccess File
  • WP-Config.php File
  • Functions.php File
  • PHP.ini File

Here’s how to alter the code of the above-mentioned file: 

.htaccess File: 

You can enhance the limit of the PHP memory by using the .htaccess file. To do this, go to the root directory and locate the .htaccess file. Then, click on the Download button to download it on your computer. 

Once you complete the downloading process, open the file on your text editor. Then, include the below codes with the PHP tag: 

1st: php_value upload_max_filesize 64M

2nd: php_value post_max_size 64M

WP-Config.php File:

You can also use the wp-config.php file to increase the PHP memory limit. For that, first, locate the file by going to the root directory. Then, right-click on the file and tap on the Download button. 

After completing the downloading process, open the file in the text editor and add the below code with the PHP tag: 

1st: define(‘WP_MEMORY_LIMIT’, ’64M’);

2nd: ini_set(‘post_max_size’, ’64M’);

3rd: ini_set(‘upload_max_filesize’, ’64M’);

Functions File: 

Download the Functions file by following the same procedure and open that in a text editor. After that, include the below code with the PHP tag: 

1st: @ini_set(‘upload_max_size’ , ’64M’);

2nd: @ini_set(‘post_max_size’, ’64M’);

3rd: @ini_set(‘max_execution_time’, ‘300’);

PHP.ini File: 

Create a php.ini file and include the following code in that. Thereafter, go to the .htaccess file of the wp-admin/ and upload the following code: 

1st: memory_limit = 64M

2nd: upload_max_filesize = 64M

3rd: post_max_size = 64M

4th: file_uploads = On

Fix 4: Uploading Fresh Versions of wp-admin and wp Includes to your Website

Uploading Fresh Versions of wp-admin and wp Includes to your Website

After trying all the above ways, if you notice that the WordPress internal server error is not resolved, then you can try this as your last resort. Backup your WordPress site and then download a fresh version of WordPress from the main website. 

Extract the file from the ZIP file and then open the extracted folder. Open the root directory of your website in an FTP client. Then, upload the wp-includes and wp-admin from the fresh version of WordPress to the directory of your website by overwriting the previous versions. 

Afterward, refresh the client and then refresh your website. Now, you can check whether the  HTTP error 500 WordPress is resolved. 

These are the most appropriate ways to resolve the WordPress internal server error. Hopefully, one of the above ways will surely help you to get rid of this issue. However, you can also contact the tech-experts to avail of the best services and fix the issue hassle-freely.

Call Now Button