Home Website TutorialsWordPress Fixing the 500 Internal Server Error on WordPress

Fixing the 500 Internal Server Error on WordPress

by Thạch Phạm

When using WordPress, there is a fairly common error which is the 500 Internal Server Error. This is a fairly common error with WordPress, and it can occur with any website on your server. And one thing that annoys us is that this is a general message, it doesn’t give us any information about the error or how to fix it.

The line Internal Server Error always makes users think that 100% of the server is at fault, but that’s not the case. So let AZDIGI learn the cause and how to fix it.

I. Causes of 500 Internal Server Error on WordPress

After many times of processing support, I have concluded that some of the most common causes for this error:

  • The .htaccess file is corrupted or some configuration section in the file is causing the error
  • Limited PHP memory
  • Plugin conflict error
  • Error from Theme
  • WordPress core error
  • Malicious code on the website
  • Error in software and services on the server
  • Server is overloaded

Server is overloaded and when you have filtered the causes, you can fix them as below.

II. Fixing the 500 Internal Server Error on WordPress

Because it’s a generic error, we can’t handle it immediately, but we need to check each part according to the main reasons we listed above.

1. Processing the .htaccess file

The first thing to do is to disable the contents of the current .htaccess file, replacing it with the default WordPress template content.

  • See template files here.

You go inside the source code, open the .htaccess file and delete the old content and enter the new content as follows:

Note: If your .htaccess file has separate configured sections, please back it up for reuse.

AZDIGI Tutorial
# BEGIN WordPress

RewriteEngine On
RewriteRule ^\.well-known\/acme-challenge\/ - [L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress
    

2. Limited PHP memory

The 500 Internal Server Error above can also occur when your PHP memory is exhausted. You can increase these limits inside your server with values like:

memory_limit
max_execution_time
max_input_vars

3. Error from Plugin

This is the most common cause of this 500 Internal Server Error. Try disabling all Plugins then visit the website to see if that fixes it.

If you no longer have access to the WordPress admin to disable Plugins, you can disable it by renaming the plugins folder in wp-contents with a different name.

4. Error from Theme

Similar to the plugin, if you can’t get inside the admin, go to wp-contents/themes, then rename the old theme folder to see if it can fix the error. After renaming the theme and you are back in the WordPress admin, please activate a WordPress original theme to process the error.

5. Error from WordPress core

Core WordPress is also one of the causes of error 500. You can back up the folder containing the web content and change the core WordPress as follows:

Step 1: Backup wp-content folder

Please download this folder or rename the folder directly on the host to any name.

Step 2: Delete the current WordPress core

Please choose all files and exclude the wp-content folder and wp-config.php file. Then delete all remaining files.

Step 3: Download the new WordPress core to use

Please download the new WordPress core and extract it. After extracting, don’t forget to move the files of the core WordPress directory outside the directory where the source code is stored.

Next, delete the wp-content folder you just extracted and rename the wp-content.bak file to wp-content to use.

Now you visit the website to check that after replacing the core of the web is working again yet.

6. Malicious code on the website

Malware can be considered a very difficult problem to handle and is also one of the causes of web errors. Currently, on AZDIGI hosting, there is a malware scanning application available, you can log in to cPanel hosting, go to cPGuard => VIRUS SCANNER => SCANNER LOGS, you will see a message about malicious code as shown below.

There is no guide to handling the malicious code web thoroughly. Instead, you should immediately contact reputable web design units for processing support and of course, you will have to pay some costs for this. But on the contrary, if your website works again, it is a very happy thing.


7. Error in software and services on the server

In addition, 2 very rare errors are service errors and overloaded servers. Because in a host/server there are many websites and some websites have 500 Internal Server Error above, this case can be excluded.

But if all the web pages on the host/server fail at the same time, you need to check the PHP service and the webserver on this server.

8. Server is overloaded

When your server is overloaded by causes such as DDoS, application software conflicts, service crashes can also occur simultaneously with websites. But usually, this error is very rare and you can check the server status with the top -c or htop command and see the load average section.

For cPanel, you can directly view the status of the server’s services in the Service Information section. If all are green ticks ✅ it means your server is working very well.

Hopefully, this article will help you better understand the 500 Internal Server Error error on WordPress and help you promptly fix this problem on your website.

You can refer to other instructions at the link below:

If you need support, you can contact support in the ways below:

Đánh giá

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign