500 internal server error is a common error that you might see on your website. One of the problems with 500 internal server error is that there is no specific reason given. It becomes hard to find the source. So, to fix 500 internal server error, we will have to do all the possible things that we can do. This article will cover all of them. You can fix the issue after doing all the things. We will see the exact ways to fix it with ease.
Overview of Internal Server Error
This is usually caused by the server misconfiguration or the limit exhaustion. If your PHP limit is exhausted, you will see this error. Also, if there are some of the problems with the database, you will see this error.
It doesn’t specifically tell you what’s the problem.
The error will say “The server encountered an internal error or misconfigured and was unable to complete your request”.
You can easily fix it. We will now see several ways to fix it.
Fix 500 Internal Server Error in WordPress
Although, we won’t make huge changes here. So, your website will face no issue. However, it is always a great idea to have a backup of your website before you make the changes. You can create a backup. So, in case something goes wrong, you can restore the website from the backup without any issues.
Once you take the backup, you can continue with the steps
Before we get into the steps, here is the easy way to expand the error.
The error only shows the basic details, right? You can expand the error and know exactly where the problem is. For that, you need to turn on the debugging mode.
Here is how to do it.
Turn on Debugging
The first step would be to turn on the debugging mode in WordPress. To enable it, you need to open the wp-config.php file from the file manager.
The file is located in the root directory itself. So, you can simply open the root directory and open it.
Once you are there inside the file, you will need to find the following code.
define( "WP_DEBUG", false );
You can use ctrl + F to find the code. Once you find the code, you can change the false to true.
If you are not able to find it, you need to add the following line in your wp-config.php file.
define( "WP_DEBUG", true );
This will turn on the debugging options and you will see the exact reasons for the error. You can then troubleshoot the error and find out the exact reason for the issue. You can then find the relevant method from this article to fix that issue.
Remember, you also need to make it false once we fix this issue. You surely don’t want to keep the debugging on for no reason. So, make sure you turn it off as soon as you fix this error.
Pro tip: Don’t close the file, you will need to change something in the file if you are planning to do the next step.
If you don’t want to do this, you can simply continue the article.
Increase WP Memory Limit
You can also increase the WP Memory limit and do the work.
The default memory doesn’t allow huge files to execute. So, you can try replacing the original memory limit with the new limit. This will increase the size limit and you might fix 500 internal server errors in WordPress.
As mentioned previously, you will have to head over to wp-config.php to increase the limit.
Make sure you download the file for backup before making the changes in it. You can revert if something goes wrong.
Open the file from the root directory in the file manager itself. You can right-click on the file and click on the code edit button. You will see the file content.
You can now add the following line to increase the file.
The line will increase the WordPress memory limit to 64 MB which is enough for the execution. You can surely do this and then try to refresh the page. In most cases, the error will be gone.
Even if the error doesn’t go, keep the line as it is. This will help you in various places. It is always a good idea to increase the limit of WordPress. You can upload the big files with this. Therefore, it is highly recommended to do this. You can then continue with the tutorial to fix 500 internal server error.
The .htaccess File
Many times, the real culprit is the .htaccess file in your hosting. This file often gets corrupted which leads us to the 500 internal server error.
If the debugging is one, you can easily know what’s the issue but what if you didn’t turn on the debugging? In such a case, you can fix the .htaccess file.
Usually, one can fix the .htaccess file by going to Settings > Permalinks. However, if your main website is facing the error, you won’t be able to access the admin panel. In that case, you can come back to the file manager where you will make the changes.
You can now click on the Settings button on the top bar and then select “Show hidden files and folder”. Now, you can see the .htaccess file. This is the same file where we will make the changes.
We will simply download that file for backup and then delete the original file.
Now, you can open the website again without uploading the file. See if the error is fixed or not. In most cases, it will be fixed.
If you are still seeing this error then it will be because of the plugin malfunction. So, we will have to find the issue and fix it. Most people are aware of the next method but we will see it for the beginners. That will surely fix the issue and will give you a completely error-free website.
Without further ado, let’s see the method.
Deactivate the Plugin
Deactivate the plugin, which plugin? This would be the first question that will come to your mind. The answer is simple. You will need to deactivate that plugin which you recently activated.
Now, if you don’t have access to the website, how can you deactivate it? For that, you can open the file manager and head over to the wp-content folder. Inside it, you will see the plugins folder.
Find the plugin that you installed recently. To delete it, you can simply hit the delete button. However, if you just want to deactivate it, you can rename it to something else. We suggest you add 1 in the end. This will deactivate the plugin.
Now, you can refresh the website and see if the issue is solved or not.
If not, you can change the name of the entire folder (plugin folder). Change the name to plugins1 or anything else. This will deactivate all the plugins. See if the error is fixed or not.
Do the same thing with the theme files.
Thereafter, you can reactivate it.
Here is the deal – if the error was gone when you deactivated all and when you activated it again, you saw the error again. You will need to activate all the plugin one by one.
Alternatively, what you can do is, you can enable debugging. The debugger will tell you which is the misbehaving plugin. This will make it easier for you to find the root cause of the issue. So, you can surely turn on the debugger here.
To turn on the debugging, you can simply go to the first method that we discuss. It’s just one line that you need to add to enable debugging.
Contact the Hosting Support
Does nothing work? You still have two options.
You can either check out the server logs and see what’s wrong. The server log file will be in the root directory. It will be a file name logs. You can check out and see what’s the issue. The logs file will tell you where is the problem at. You can check it out and know yourself. If not, there is still one way left which will surely give you a solution.
Alternatively, you can contact the hosting provider. The hosting provider will tell you what you should do next. If there is some problem with the server-side, they will also fix the issue. That’s why it is always better to contact the support and ask them about the issue. They will fix it for you. You can then continue with your work and focus on the content or your business.
These are some of the easiest ways to fix 500 internal server error in WordPress. If you are also facing this issue, you can try out all these methods one by one to fix it. For the people who turned on debugging, don’t forget to close it after the work is finished.