Advance

How to fix Internal Server Error 500

How to fix Internal Server Error 500

How to fix Internal Server Error 500. Error 500 (HTTP Error 500) is the same as Internal Server Error. This error is one of the HTTP status codes known as errors that the site may encounter for various reasons.

In this article, due to the very high popularity of WordPress and the greater use of this content management system by users, we will fix the 500 error in WordPress.

 

Linux Web Hosting Plans in Eldernode

 

This error message appears in different situations, but they all mean the same thing. Depending on the website you are visiting, you may encounter the following messages:

500 Internal Server Error    500 Error    HTTP Error 500    500 That’s an error    (Temporary Error (500

In total, 5xx errors are errors that occur from the server or host. Therefore, we must explore the server to find the necessary solutions.

 

How to fix Internal Server Error 500

 

Follow the steps below to find the root cause of the error 500 and how to fix it.

Recommended Article: Web Disk on Cpanel

1) Check error_log

The first step in case the site encounters an error is to check the site log error. By observing the log error, you can identify the problem faster and take action to fix it.

Many times when we see an Internal Server Error, the reason for this problem is displayed in the error log section of the host control panel.

To control the CPanel, click on the Errors option in the Metrics section.

 

How to fix Internal Server Error 500

 

In content management systems, it is also possible to view errors through their configuration file.

To do this, proceed as follows:

 

Enable error viewing in WordPress

In the Host Control Panel, open the wp-config.php file in public_html.

Then change the value of WP_DEBUG to true.

 

How to fix Internal Server Error 500

 

Enable error viewing in Joomla

To enable error detection on Joomla sites in the configuration.php file, change the error_reporting value as follows:

public $error_reporting = '1';

 

Enable error viewing in Prestashop

To view prestashop errors, you must edit the defines.inc.php file in / home / username / public_html / config.

For this purpose, change the value of define(‘PS_MODE_DEV ‘, false ); to define (‘PS_MODE_DEV‘, true);.

Note: After viewing the error, reset the change to the previous state. Because it is not appropriate for visitors to view warnings and errors on the site.

 

2) Check the .htaccess file

To check this file, you need to change the file name. For example, change the original name to htaccess_old.

To make sure the problem is with this file, rename the file to htaccess_old, for example.

To do this, enter the host and filemanager section and enter the public_html folder.

Rename the current .htaccess file to htaccess_old or a custom name.

Create a new file called .htaccess and enter the following code in it and then check the site again without error:

# BEGIN WordPress    <IfModule mod_rewrite.c>    RewriteEngine On    RewriteBase /    RewriteRule ^index\.php$ - [L]    RewriteCond %{REQUEST_FILENAME} !-f    RewriteCond %{REQUEST_FILENAME} !-d    RewriteRule . /index.php [L]    </IfModule>    # END WordPress

If after this you see the site without error, then the problem is solved. Now you need to add the htaccess code line by line to see which line the problem is from.

 

Also, see:

htaccess and its Various Applications

 

3) Disable plugins

Whether you use WordPress, Joomla or any other content management system, you have a series of plugins (or modules) on your content management system that if enabled will result in a error 500.

So the next method is to disable all site plugins in order to detect the error.

To disable plugins, do the following:

a- Open your WordPress dashboard.

b- From the Plugins section, click on Installed Plugins.

c- After viewing the list of plugins, click “Disable” below each plugin.

Note: If you do not have access to site management, change the access level of the Plugins folder to zero through the file manager.

 

4) Check the database settings

The database specifications created on the host must be the same as the specifications listed in the wp-config.php file.

For example, if the site is designed with WordPress, the database name, database username and password must be the same as the database name, database username, and password created on the host.

 

5) Change the template to the default WordPress template

Sometimes the error 500 in WordPress may be due to the template you are using.

For security and the final solution, you can disable the current template and use one of the default WordPress templates.

If you have access to the WordPress counter, go to View >> Themes, select one of the default WordPress templates, and click the Enable button.

If you do not have access to the WordPress counter, do the following to disable the current template:

1. Enter host.

2. In the File Manager, go to public_html >> wp-content >> themes.

3. Select the template folder you are using and right-click on it.

4. Select the Rename option and in the window that opens, select the desired name for the template folder.

5. Save changes.

In this case, the template will be disabled and one of the default WordPress templates will be activated as a site template. Then you can check the site and see if error 500 are still displayed on the site or not!

 

6) WordPress file corruption

Important files in your WordPress kernel may be corrupted.

Note: Be sure to backup data before making changes.

Then download the latest version of WordPress from the official WordPress website and delete the wp-content folder and the wp-config.php file from the download file. Replace other existing folders and files with folders and files on your hosts.

This will not delete your data and will only fix the problem if there is a problem with the WordPress kernel.

Recommended Article: How To Install Yarn On CentOS 8

Dear user, we hope you would enjoy this tutorial, you can ask questions about this training in the comments section, or to solve other problems in the field of Eldernode training, refer to the Ask page section and raise your problem in it as soon as possible. Make time for other users and experts to answer your questions.

How to fix Internal Server Error 500.

Goodluck.

We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave Your Comment

Your email address will not be published.

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+18054214518

7 days a week, 24 hours a day