As hard as it may be to believe, a 500 internal server error is more common than you would think. Let’s say that your website was working just fine until a few days back, when it went belly up and now, you are seeing a 500 internal server error on every page of your website.
The first thing that you need to do is to not panic and yes, that’s easier said than done.
And the issue in question can be fixed easily with a few steps and your website should be back to normal in no time at all.
Make sure that you check out the steps listed below so that you can understand what the issue is all about and how to fix the 500 internal server errors on your WordPress website.
500 internal server errors:
This error often occurs when your server fails to display the page that you had requested, for one reason or the other. An internal server error is an application side error and one that often crops up when the server said fails to display the website that you had requested.
This is why it is always a good idea to opt for a hosting package that comes with automatic backup. The moment you enter the URL on the address bar, the server tries to display the website in question and fails to do so, and that’s when the 500 internal server error crops up.
Create a WordPress backup:
It goes without saying that you need to opt for hosting packages that come with automatic back up. The good news is that most of the WordPress hosting packages offer you the same and other than that, you can easily set it up on your own as well.
Resolving the issue:
The server side can develop faults and like humans are prone to do, they can make mistakes as well. So the first thing that you need to do when facing a 500 internal server error is to trouble shoot the problem and find out what is causing this particular error to crop up.
The two most common causes for a 500 internal server error happen to be a corrupted .htaccess file and PHP memory limit.
Both of these can often cause your website to develop internal server errors and please keep in mind that if after following the steps listed below, the issue is still not resolved, that means that the issue in question is more serious.
HT access file error fix:
One of the key files in your PHP database is your HT access file; and if the file in question is corrupted, then this can cause you to experience some server side issues such as 500 internal server error; this particular file often gets corrupted as a result of a module or a broken installation theme. The first thing that you need to do is to login to your FTP account and access your HT access file.
You should see the HT access file being clearly listed with the others in the directory, and now that you have located it, all you have to do is to download the same to the local computer from the live server so that you can tweak it. Just open the file in your text editor such as Notepad ++ or Dreamweaver.
You can then navigate to this link: https://codex.WordPress.org/htaccess and copy – paste the version of the code that fits best for your website.
Then, save the .htaccess file and upload it to the live server. The code may differ somewhat depending on your current WordPress configuration and what you are running on at the moment. Once you are done, upload the file to your server, reload it and see if the issue has been fixed.
PHP memory limit:
One of the other reasons that you may be facing this 500 internal server error issue is on account of the PHP memory limit. Please keep in mind that your host and WordPress sets the PHP memory by default and this can cause more than a few issues to crop up.
You can easily adjust the PHP memory limit and increase it by the steps listed below and this should help take care of the internal server error issue.
Just head over to the functions.php file of your website; you should be able to access the same in your root directory. Now, download the file and open it up in your text editor and include the code listed here below the opening PHP tags.
1. @ini_set(‘upload_max_size’ , ’64M’);
2. @ini_set(‘post_max_size’, ’64M’);
3. @ini_set(‘max_execution_time’, ‘300’);
Once you have included the codes, just upload the file back to the root, reload it and that’s it.
2. HT access file:
you can also increase your PHP memory limit by going over to your HT access file. Just head over to your root directory, right click on the HT access file, and download it to your PC and your text editor. You should be able to fix the same with ease by including this code with the opening PHP tags.
1. php_value upload_max_filesize 64M
2. php_value post_max_size 64M
3. WP-Config file: You can also tweak the WP-Config file to fix your PHP memory limit; and like before, just head
over to your root directory, right click on your WP-Config file, download it to your PC and open the same in your editor. All you have to do is to install the following codes and that should do the trick.
1. define(‘WP_MEMORY_LIMIT’, ’64M’);
2. ini_set(‘post_max_size’, ’64M’);
3. ini_set(‘upload_max_filesize’, ’64M’);
4. PHP ini file: Here you need to create a fresh PHP ini file and include the following codes and upload the same to
your WP admin directory.
1. memory_limit = 64M
2. upload_max_filesize = 64M
3. post_max_size = 64M
4. file_uploads = On
Once you have done so, just upload the file to the said directory, reload your website and it should be back to working just fine.
However, if you are still facing issues, then you may want to do a plugin audit. It is important that you do one anyway as it can help you keep your website running seamlessly.
Some of the plugins can develop compatibility issues after a while which is why a plugin audit assumes importance Moreover, the same issue can help contribute to your problem in more ways than one including causing your website to develop a 500 internal server error.
Just head over to the admin panel of your website, deactivate your plugins one by one, refresh your website and see if it is working perfectly.
Outdated plugins are more prone to developing compatibility issues which is why you need to handle this right away before it becomes a full blown issue. Remember to first check the plugin folder, here is what you need to do.
You need to head over to your root directory and under wp-content, try and change the name of the plugin folder, and see if that helps to resolve the issue.
If it does, then the issue is with one of your plugins and now you can test each plugin individually to see which one has gone rogue.
Just head back to the plugin folder, and now, change the name of each plugin, reload your site and see if that takes care of the issue. Once you have located the rogue plugin, all that’s left is for you to delete the same or get an update and get the plugin sorted out.
If your problem persists, then you need to contact your hosting provider and inform them of the same. Make a detailed brief, outlining the issue and what needs to be tackled and they’ll look into the same.
You may also face multiple issues in addition to the 500 error, but with some patience and time, you should be able to get your website functioning normally again.
It is important that you take immediate steps to resolve this issue once it crops up as it can impact your traffic and can even cause you to drop in rankings as well. Furthermore, prospective customers are not going to want to sit around until the issue has been resolved.
So, if the website in question is a professional website then it is one that you would want up and running at the earliest.
If after following all the steps, your issue has not been resolved, then that means that you have a serious issue and one that you need to get fixed right away.
These are some of the ways by which you can fix a 500 internal server error issue immediately.