The 500 Internal Server Errors is one of the most frustrating errors you can experience with WordPress. It could mean almost anything. 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 version of PHP 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.
- Disable 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. But many hosting providers automatically upgrade the PHP version. It can cause incompatibility with the current version of WordPress.
For example, if you are using WordPress 5.1.2 and the hosting is automatically updated to PHP 8.0.0, you can get the 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. There is a known incompatibility between some versions of PHP and WooCommerce plugins. But as many people want to keep their purchase deals and product-related interface.
In such a case, you can try a different woo-commerce plugin 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 go away if you install a new WordPress site with the 6.0.2 version. But it is not always possible. You have an existing site for which you need to 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 seem to have some problems. For example, libiconv library had an issue with that version.
For that, you need to compile your code and link libiconv separately. PHP 7.4.3 could also solve the problem.
Wordfence and other Security Plugins
Some 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.
In another case, you could up the PHP memory limit to suit the plugin’s needs. Some security plugins take a lot of resources. That is why 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, you need to disable it 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, if your theme is old and not updated, you could have issues. 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 in the form of code to the file. But this can cause 500 issues with the current PHP version.
For that purpose rename the .htacess file to something .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 to access your server’s error logs to see if there is more information about what is causing the error. Finally, you can try increasing 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’re still seeing the “500 internal server error” message, it may be because of an incorrect rule in your WordPress admin panel. Simply go to your WordPress admin panel and delete the offending rule to fix this.
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?
WordPress 500 errors can be caused by many things, 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 trying to connect 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 have too many plugins installed or if your theme is not well coded. If you are on a VPS or Dedicated server, you may need to increase your memory limit in your php.ini file.