Fixing WordPress 500 internal server error requires a lot of troubleshooting and can consume your time when trying to fix it. The common causes of this 500 internal server error are extending the memory limit of your PHP server and having a corrupted .htaccess file. A corrupted .htaccess file occurs when you install a plugin or make other changes to your WordPress site which end up corrupting your WordPress directory. To fix this error all you need is to create a new .htaccess file.
PHP memory limit can occur due to a poorly coded plugin running on your site, or when your site grows considerably thus using too many plugins. Below are ways in which you can fix that error and eliminate the stress that comes along with trying to fix the error.
Before you start implementing these solutions to fix the error, backup your site. Use your preferred FTP client to enable you to edit and access the files on your site.
1. How to create a new .htaccess file on wordpress:
Open your preferred FTP client to access your files; there you will see several folders like wp-admin, wp-content and so on. Rename the file by right clicking .htaccess and reaming it to .htaccess.bak. Save these changes by going to the bottom of your WordPress admin area and under Settings, select Permalinks.
Once you have renamed the file and saved the changes, reload your website browser to check if the error has cleared. If the error does not clear, then it means it had not occurred due to a corrupted .htaccess file. Thus look into the PHP memory.
2. How to increase PHP memory limit:
To increase PHP memory limit, open your root directory and go to wp-config.php file. Right click on this file, and select the Download option.
Open the file using the text editor of your choice, add the bit of code under this PHP tag; define (‘WP_MEMORY_LIMIT’, ’64M’);
Save this file, then upload it to your root directory. This will overwrite the original file. Refresh the FTP client then refresh your site.
If after following the process you still having the error, then you are not having an issue with your PHP. Then if this happens, remove the code from the wp-config.php file, save it then upload it again to your root directory.
If you have followed the above process and you still have the error, it is advisable to contact your host. Support quality differs from one host to another. Most of them when you first contact them, they always tell you to check your plugins and themes. Explain to them what you have done to try and eliminate the error. This will prompt them to check and see if their server logs are causing the error.
To prevent the 500 internal server error WordPress in the first place, backup your files on a regular basis, always update your plugins and themes, and always ask your theme developer if their themes are compatible with the plugins you are using on your site to prevent the .htaccess files from being corrupted.