Table of Contents
500 Internal Server Errors is one of the most frustrating errors you can experience with WordPress. It could mean almost anything. However, it doesn’t mean you can’t fix it; you can, and one of the fixes below should be able to get your site back up again.
WordPress has upgraded its PHP version from 7.0 to 8.0. Unfortunately, the new version of PHP causes some plugins to block admin requests with a 500 error.
Common Reasons for WordPress 500 error after PHP update
- The new version is not compatible
- Woocommerce plugins incompatibility
- Low memory limit of PHP resources
- Problem with PHP libraries
- Addition of firewall and security plugins
- Plugin or Theme conflicts
- .htaccess rules
First Aid Check for WordPress PHP Error 500 after an update
To make things simple and troubleshooting easy, you can follow these steps.
- Change your theme to the WordPress default theme like twenty-twenty-two.
- Turn off all your plugins.
- Downgrade your PHP version to the earlier stable version.
Check for PHP errors. If there is no error, you can debug each conditioning step.
Solutions
As you have found out, the WordPress 500 error can occur for different reasons. However, many hosting providers automatically upgrade the PHP version, which can cause incompatibility with the current version of WordPress.
For example, if you use WordPress 5.1.2 and the hosting is automatically updated to PHP 8.0.0, you can get a 500 error. In that case, you need to revert to the old PHP version that works.
WooCommerce Plugin Incompatibility
Many eCommerce and store owners using WooCommerce plugins have encountered 500 PHP errors. Some versions of PHP and WooCommerce plugins are known to be incompatible, but many people want to keep their purchase deals and product-related interfaces.
In such a case, you can try a different woo-commerce plugin that is compatible with your PHP version. Otherwise, follow the solution below.
Low Memory Limit of PHP Resources
After changing from PHP 7.3 to 7.4 or 8.0, you can get a 500 error. This error could disappear if you install a new WordPress site with the 6.6.1 version. But it is only sometimes possible. You have an existing site for which you must repair the 500 error.
You can update the WordPress version and then upgrade to the PHP version. Check the results. If you still get the 500 error, you can try other solutions. Wrong values for memory_limit and post_max_size could be an issue. Increase the memory limit, and you are good to go.
PHP libraries
Some WordPress developers and designers use PHP libraries to make forms and plugins interact with PHP code and data. WooCommerce and PHP 7.4.2 have some problems. For example, libiconv library had an issue with that version.
To do this, you must compile your code and link the libiconv separately. PHP 7.4.3 could also solve the problem.
Wordfence and other Security Plugins
Some WordPress security plugins create separate files when they are installed. For example, WordFence uses files like .user.ini and others. They have paths to the PHP version. If you change the path to the correct version, the problem could be solved.
Alternatively, you could increase the PHP memory limit to suit the plugin’s needs. Some security plugins require a lot of resources, so you need to take that step.
Plugin and Theme conflicts
When an old plugin is being used, and a new PHP version is updated, they can be incompatible. So, talk with the plugin author and ask him about the compatible PHP version. Since you cannot have different PHP versions for other plugins, turn it off if required.
Otherwise, you need to revert to the old PHP version. It solves the 500 error in many cases.
Themes interact with databases and PHP.
For that purpose, you could have issues if your theme is old and needs to be updated. So, update the theme and then upgrade the PHP version. If you cannot update the theme for different reasons, downgrade the PHP to a more stable performance.
It should solve the 500 error.
Rename the .htaccess file and change the rules
It is one of the files in the root of your site folder. By default, every hosting adds some WordPress code to it. Some of them add additional code.
This is where the problem crops up. For example, the iTheme security plugin adds .htaccess rules as code to the file. However, this can cause 500 issues with the current version of PHP.
For that purpose, rename the .htacess file to something like .htaccess_old or .htaccess_backup. Then, test your site. If everything works fine, then you need to amend your .htaccess rules.
FAQ
How do I fix error 500 on WordPress?
First, try reloading the page. If that doesn’t work, try clearing your browser cache. If that still doesn’t work, you can try accessing your server’s error logs to see if there is more information about what is causing the error. Finally, you can increase your PHP memory limit if all else fails.
How can I fix 500 errors in PHP?
Look for permission errors: If you see a “500 internal server error” message, it may be caused by a problem with your file permissions. To fix this, set your file permissions to 755.
Check WordPress admin panel rules: If you still see the “500 internal server error” message, it may be because of an incorrect rule in your WordPress admin panel. To fix this, go to your WordPress admin panel and delete the offending rule.
What is a 500 Internal server error WordPress?
Check for a theme or plugin conflict:
- Deactivate all WordPress themes and plugins except for the default WordPress theme. If you can access your WordPress site, it was likely caused by a plugin or theme you have installed.
- Try activating each plugin one by one to see if there are any improvements.
- If you are still experiencing issues, try switching to the default WordPress theme by renaming your current theme’s folder in /wp-content/themes/.
What causes 500 errors in PHP?
Many things can cause WordPress 500 errors, but most commonly, it is a problem with your web hosting. If you are on shared hosting, such as HostGator, your site may share a server with too many other sites. This can cause the server to time out when connecting to your site.
Another common cause of 500 errors is when your PHP scripts exceed the server’s memory limit. This can happen if you install too many plugins or your theme needs to be better-coded. If you are on a VPS or Dedicated server, you may need to increase the memory limit in your php.ini file.