If you are getting the 500 internal-server error on your WordPress website and are unsure how to get it fixed, then keep reading.
Internal server errors are one of the most common errors that you will face. The only problem with these errors is that they don’t give out any information that you can use to solve them easily. This is something that many beginners find frustrating.
In this article, we will find out how to fix these internal server errors on your WordPress website with minimum fuss and worry.
Let’s get started.
What are 500 Internal Server Errors? Why Do They Occur?
The 500 internal server error only lets the user know that the page is not working for some specific reason. It doesn’t tell anything else to the user such as the way to troubleshoot it. There can be multiple reasons for a 500 internal server error. But most of the time, they are due to a lack of server resources.
Here is what you should know about the 500 Server Error:
- The problem is not with your computer but the server that is serving the web pages
- Try reloading the webpage by pressing Ctrl+f5 to make sure a hard refresh occurs
- Try clearing your browser cache. In some cases, the browser is loading the page from the cache and hence showing the 500 server error
- Check the error logs from cPanel to see what errors are occurring on your WordPress website
Once you have tried these steps and are still stuck at the 500 internal server error screens then move to the solutions available below.
Check if the .htaccess File is Corrupted
1. First, you will have to make sure that the .htaccess file is working properly and is not corrupted in any way. To do so, rename the .htaccess file to .htaccess_old. You will need to login to your site through cPanel or FTP dashboard to do so.
2. Once you have renamed the file, try opening your website again. In most cases, you will be able to solve your problem by renaming the .htaccess file. If the error still shows on your screen, then move to the second step.
But before that, you need to generate a new .htaccess file in cPanel. To do so, go to Settings > Permalinks > now click on SAVE without making any changes to the page. This will generate a new .htaccess file with proper rewrite rules.
Tired of Website Server Errors? Give Us a Call
Increase PHP Memory Limit
Every web server has a certain PHP limit for each website hosted on it. If you are getting the 500 Server Error, then there is a fair chance that the PHP memory limit is exhausted.
Here is a simple way to increase the PHP memory limit on your website.
- Create a php.ini file on your website if it still doesn’t exist
- Add the following line to it. Or alter the current memory limit if the file had the line in it.
The purpose of increasing the memory limit is to allow at least 64MB of data to be passed or uploaded at a single time.
3. Save the file and then upload it to /wp-admin/ folder. You can use FTP or cPanel to add the file to your website hosting solution
Several users have said that doing the above fixed the admin side problem for them.
If increasing the memory limit fixed the problem for you, then you have only fixed the problem temporarily. You still need to find the cause that is exhausting your memory limit.
This could be a poorly coded plugin or even a theme function. We strongly recommend that you ask your WordPress web hosting company to look into the server logs to help you find the exact diagnostics.
If increasing the PHP memory limit did not fix the issue for you, then you are in for some more troubleshooting.
If the above solution fixed your WordPress 500 server error problem, then that’s good. But you should know that this is a temporary solution only. To fix the problem permanently, you will need to ask your web hosting company to look at the server logs and tell what script or code is actually causing the problem. In most cases, the problem is through a badly coded script, a corrupted plugin, or a bad theme.
You will then need to disable or uninstall those scripts from your website.
However, if your problem is still not solved, then move to the next step.
Not Sure How to Fix 500 Server Error? Give Us a Call
Deactivate All Plugins
Deactivating all plugins on the website is fairly easy through FTP or cPanel. You just need to go to public_html > wp-content and then search for the plugins directory.
The plugins directory needs to be renamed to something else so that WordPress can’t find it. When it is not able to find the plugins installed on your website, it will automatically disable all of them.
Here we are replacing the ‘Plugins’ directory with the ‘Plugins.deactivate’ directory.
Now, try opening your website in the browser. If your website works, then you will have to manually check each plugin and see which one was causing the problem. However, if the problem still persists then you would need to reinstall the core files on your WordPress website. Here is how to do that.
Reinstalling WordPress Core Files
First, download the fresh installation of WordPress core files from the WordPress.org website. Once you have the core files downloaded on your system, you would need to add them to your website hosting using an FTP client.
- First, open the Public_html folder and then locate wp-admin, wp-includes, and wp-content files.
- Now, from the directory on your local drive, select wp-admin and wp-includes. Click on upload to transfer these files from the local drive to your web hosting server.
- Make sure that you ‘Overwrite’ the files instead of copying them as separate files.
This will overwrite the existing files and you will have a fresh new installation. That is it. If the core file was corrupted, overwriting the files would fix the internal server error problem.
We have discussed four ways to solve the 500 Server Error problem. We hope that one of these ways has helped you fix your issue.
The ways to solve the 500 Server Error include:
- Checking if the .htaccess file is corrupt
- Increasing PHP memory limit
- Deactivating plugins
- Reinstalling Core Files
If none of these ways has solved the 500-server error problem for your website, then you can directly get in touch with our WordPress experts who can troubleshoot your website and ensure that the site is up and running in no time.
Still Facing the 500 Server Error? Give Us a Call