When server face some issue and can’t handle some request, we saw an Internal Server Error (500) on a WordPress website. There are too many reasons behind this error like WordPress core issue, theme issue or corrupt plugin.
By following the below steps, you can fix this problem.
How to Fix It:
- Check Error Logs: You can enable WordPress debug mode by adding the given code in your wp-config.php file.
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Add this code in wp-config.php file before the /* That’s all, stop editing! */ line. You can see the log errors to the wp-content/debug.log file.
- Check File and Folder Permissions: Ensure correct permissions.
- Folders: 755
- Files: 644
- wp-config.php: 440 or 400
- Deactivate Plugins
- Access your site via FTP or File Manager.
- Rename the wp-content/plugins folder to plugins_backup or any other name.
- If the error resolves, a plugin is the cause. Rename the folder back to plugins and deactivate/reactivate plugins one by one and you will find the corrupt plugin.
- Switch to Default Theme
- Rename your current theme folder (wp-content/themes/activate-theme-name) to something like activate-theme-name_backup or any other name.
- WordPress will activate a default theme. If the error resolves, there must be a null or corrupt theme issue.
- Check .htaccess File
- Rename the .htaccess file in your WordPress root directory to .htaccess_backup or any other name.
- Log in to your WordPress dashboard and go to Settings > Permalinks in your WordPress dashboard to regenerate the file.
- Increase PHP Memory Limit
- Increase memory limit from Select PHP Version>Option. Set it to max limit.
- Or edit the wp.config.php file and add the code to its bottom.
define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '512M');
- Replace WordPress Core Files
- Download a fresh version of WordPress from WordPress.org.
- Now change every file and folder from the root directory except the wp-config.php file and the wp-content folder.
- Update PHP Version
- Make sure that your server is running a supported stable PHP version (currently PHP 8.3 or higher).
- You can update this from your hosting control panel search>select php version> update php version.
- Contact Your Host
- If all of the above steps fails, please contact your web host’s support team. They can check server configurations and provide you the solution for the error.
We hope this article might be helpful for you. If you fix your problem, tell us which step help you most.