Hello everyone. I’m gonna show you few methods to fix the 500 internal error you may be experiencing on WordPress. So let’s get right into it.
The 500 internal server error runs on every page of your site when there’s a problem with the server or file system. The cause most likely occurs in the root directory where your WordPress files are but it can also be caused by a problem on your host server. I’m going to show you a few ways, you can fix this problem.
But before we begin I recommend you make Backup of your site before trying any of this solution in case something goes wrong.
Create a New “.htaccess” file
A common cause of this error is a corrupted “.htaccess” file. It can become corrupted after you install a plugin or make other change to your WordPress site. The fix is simple since all you need to is create a new “.htaccess” file.
Open up your WordPress root directory in preferred FTP client. This is typically called public_html. If you see folders name wp-admin, wp-content, wp-includes, you’re in the right place. If you don’t see your “.htaccess” file or Dot files, for that matter make hidden files viewable by clicking the server and selecting force showing hidden files. Now This will differ for every FTP client. I’m Using FileZilla But it should be pretty similar.
Once you should find your “.htaccess” file, rename it “.htaccess.off”. This essentially deletes your site’s “.htacces” file. So now we need to create a new one. Go to your WordPress admin area, hover over setting and click permalinks. Scroll down to the bottom of the page and hit Save Changes. Now reload your site and see if the 500 internal server error is gone, it was caused a corrupt ".htaccess" file.
It’s also worth mentioning that an improperly named “.htaccess” file will cause this error to run on your site. So make sure it’s not named anything other than “.htaccess”.
So if you’re still having an issue, then let’s talk about another common cause of this issue, which is exceeding your servers “PHP Memory Limit”.
PHP Memory limit Issue In WordPress
This usually happens because of poorly coded plugin running on your site or using too many plugins. You’ll begin to exceed the PHP memory limits set by your hosting provider and either of those things happens, the result becomes a
500 internal server error.
Once again open up your root directory and locate the wp-config.php file. Open your file in your preferred text editor and add this bit of code under the opening PHP tag:
PHP Memory Limit
define( 'WP_MEMORY_LIMIT', '256M' );
Save the file and re-uploaded it to your root directory. Now go ahead and refresh your website. If you’re still seeing the error, then you’re not having “PHP memory limit issues. If that did not fix the issue, then remove those line of code. Because it wasn't a problem. If those line of code worked, then great.
I still recommended figuring out what caused you to reach the limit and you could always ask your host to increase the limit on your server.
But if both of those solutions did not work for you then let’s try a few less common solutions.
If you’re able to access the WordPress admin area, deactivate your plugins one by one. Refresh your website after each deactivation and if the error disappears, it likely caused by that plugin.
If you cannot access the WordPress admin area, then go back your FTP client and open the root directory and open up the wp-content folder. This folder contains your plugins, your themes and other folders. Rename the plugins folder to anything you wish like "plugins.off". This deactivates all the plugins on your site.
Now refresh your site and check If the error is gone.It was caused by a faulty plugin. After going back and enable them one by one to figure out the culprit. If that didn't work then be sure to revert your folder back to just plugins.
AS for other solutions which are more unlikely. You can check the file permissions in your WordPress directory. They should be 755 or 644. If not, the could be causing the 500 internal server error.
Upload Fresh Version
You can also upload fresh versions of wp-admin and wp-includes to your site. But this should be a last resort. Again backup your website before trying this.
Once you do simply redownload WordPress and only upload the wp-admin and wp-includes folder to your root. If this works, that means you had a corrupted core file.
If none of these solutions worked for you then the only option left is to give up.
Ha Ha Ha…Don’t worry, I’m just kidding.
What you need to do now is contact your host. Many hosts won’t be much of a help in and they’ll actually blame your site’s files for the issue which again is definitely a possibility. So you've really tried all the steps I mentioned before contacting them. If you tried everything then politely ask them their server logs to see if the issue is there.
At the end of the day, I recommended you backup your website on a regular basis and update your plugin, themes, and WordPress core files as soon as they’re available to prevent this from happening