How to solve WordPress 500 errors?
Several issues, including corrupted files, plugin conflicts, or server misconfigurations can cause a 500 Internal Server Error in WordPress on Hostinger. Here’s how you can fix it:
1. Enable Debugging Mode
- Connect to your website via File Manager (in Hostinger’s hPanel) or FTP.
- Open the
wp-config.php
file and add the following lines before/* That's all, stop editing! */
:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
Check the wp-content/debug.log
file for error details.
2. Increase PHP Memory Limit
In wp-config.php
, add this line
define('WP_MEMORY_LIMIT', '256M');
If the error is due to insufficient memory, this should fix it.
3. Deactivate Plugins
- Go to File Manager or use FTP and navigate to
wp-content/plugins/
. - Rename the
plugins
folder toplugins_old
to deactivate all plugins. - If your website works, rename it back and activate plugins one by one in the WordPress dashboard.
4. Check .htaccess File
- In the File Manager, find the
.htaccess
file in the root directory (public_html
). - Rename it to
.htaccess_old
. - Create a new
.htaccess
file and add the default WordPress rules.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Save and check if the error is gone.
5. Change PHP Version
- Go to hPanel > Advanced > PHP Configuration.
- Try switching between PHP 7.4, 8.0, or 8.1 and check if the issue resolves.
6. Re-upload Core WordPress Files
- Download a fresh copy of WordPress from wordpress.org.
- Upload the
wp-admin
andwp-includes
folders to replace the existing ones.
7. Contact Hostinger Support
If none of these work, contact Hostinger Support for assistance, as the issue might be on the server side.
Let me know if you need help with any step!
Thanks for reading 😊