fix-interrnal-server-in-woocommerce

Fix Internal Server Error in WooCommerce: 500 Internal Server Error

Internet users and site owners periodically encounter various errors on web pages and one of the most common errors include the 500 internal server error. So in this article, we’ll talk about the various methods to help you to fix internal server error in WooCommerce.

Due to the generic nature of this error, the exact cause of this error might be unknown. This can be really frustrating. So before we solve it, let’s get a better understanding of the error first.

What is the 500 internal server error?

The 500 internal server error is a general HTTP status code where one of the standard server responses to a browser request. Other examples of other HTTP codes are 403 Forbidden, 404 Not Found, or 503 Service Unavailable.

Specifically, a 500 internal server error occurs when a browser or other client sends a request to the server, but the server cannot process it due to an unexpected error. And the server can’t be more specific about what exactly the problem is.

The error may appear in different ways depending on various factors. These factors may be your browser, web server, hosting control panel, operating system, and the engine or framework that the site is running on.

For example, this is how the standard 500 internal server error pages of four popular web servers look: Apache, Nginx, LiteSpeed, ​​and IIS 7.

Internal Server Error in Various Web Server

Besides the layout, the text on the page may also be different. Here are some of the text variations:

  • 500 error
  • HTTP Error 500
  • Internal Server Error
  • 500 Server Error
  • HTTP 500 – Internal Server Error
  • The website cannot display the page
  • Error establishing a database connection
  • Error: Request failed with status code 500
  • The site encountered a critical error.
  • The site is experiencing technical difficulties.

As you can see, 500 internal server errors are shown as collective messages that occur when something did not work as expected. This is because a thousand different things can cause a server to break, and it ma be impossible to figure out what is the exact cause.

Even though that’s the case, some of the most common situations that might be causing 500 internal server errors to your WooCommerce site are:

  • Invalid .htaccess file syntax
  • Error in site’s scripts
  • Out of RAM
  • Conflicts between themes and plugins

How to fix the 500 internal server error in WooCommerce?

Once you figure out the causes of 500 Internal Server Errors, you might have a rough idea of how to fix them. Whether or not you have the right idea to make your WooCommerce site up and running, you can still use the following tips to fix the internal server error in WooCommerce.

But before moving forward we strongly advise you to back up your website first because some of these tips require you to edit the core files. Make sure to keep copies of not only the files but the databases too.

After your website has been safely backed up, you may begin working on resolving the 500 internal server error.

1. Enable Debug

The first thing you can do to fix the internal server error in WooCommerce is by enabling debug which helps you to identify the issue in your site. You can either install a plugin or edit the wpconfig.php file to enable debugging. To access the wp-config.php file you’ll need to have the credentials of your cPanel.

Once you are logged in go to the files and click on “File Manager”. Now, you’ll see all of your WordPress site files. All you need to do is navigate to the wp-config.php file. Usually, you can find the file in your public_html (root) folder.

Then, once you have found the file you should edit it by clicking right-click. Search for the code “define (‘WP_DEBUG’, false);

fix-internal-server-error-in-woocommerce

In most of the cases, WP_DEBUG is set to false by default. You can replace the “false” with “true”.

define( ‘WP_DEBUG’, true );
fix-internal-server-error-in-woocommerce

Make sure to click on the “Save Changes” button right after you edit the file.

This enables the debugging mode within your website. The errors can be troubleshot later from your WordPress website.

You can find the error log inside the the/wp-content/debug.log file. With the help of the error log, you’ll be able to identify the error and solve it.

Also, don’t forget to disable the debug mode once you have found and fixed the error.

You can disable the debug mode by adding a /* before and a */ after the code.

/*
define( ‘WP_DEBUG’, true );
*/

Now, if you’re looking for an easy solution that doesn’t require any coding, you can also use one of the WordPress plugins to enable debugging like:

2. Check corrupt .htaccess files

The WordPress 500 internal server error can also be fixed by checking for a corrupted or damaged .htaccess file.

You can do so by renaming your .htaccess file and configuring it. In order to rename the .htaccess file, you will need to log in to your site using the “File Manager” application in your hosting account’s cPanel or FTP client.

We’ll use the FTP here. Once you’ve connected, the .htaccess file will be located in the root directory within the WordPress folders. Just right-click on it and rename it to .htacess old.

If you are having trouble finding it, you can have a look at our guide on how to fix the .htaccess file as well.

After renaming the .htaccess file, try visiting your site to see if this resolved the issue. If it did, congratulation because you fixed the 500 internal server error.

fix-internal-server-error-in-woocommerce

Also, make sure that you go to the Settings > Permalinks page in the WordPress admin and Save the changes too.

fix-internal-server-error-in-woocommerce

This will generate a new .htaccess file for you with proper rewrite rules to ensure your post pages don’t return a 500 internal server error.

Now, you can delete the old .htaccess file by returning to the server once again. If you do not see the new file, try to refresh the page.

3. Deactivate the plugins

It’s also possible that the 500 internal server error is most likely caused by a specific plugin. You may have one or more plugins that might not be compatible with your theme or even be conflicting with each other.

Unfortunately, there is no easy way to find that particular plugin causing the problem. The only solution is to deactivate the plugins.

You can deactivate the plugins one by one. But it’ll be a bit time-consuming if you have many plugins. Thankfully, you can select and delete the plugins in bulk too.

First, select all the plugins and choose the “Deactivate” option from the dropdown and make sure to click on the “Apply” button.

fix-internal-server-error-in-woocommerce

This method works perfectly if you have access to the backend of your WordPress site. But in case you don’t have the access to the backend, you can also use the cPanel or FTP to deactivate all your plugins.

If deactivating all of the plugins fixed the error, then we know that one of the plugins is the cause of all trouble.

Now to identify the plugin we have to reactivate one plugin at a time. For that, go to Plugins > Installed Plugins from your WordPress dashboard. You can see a list of all the plugins that you have on your site. Click on ‘Activate’.

fix-internal-server-error-in-woocommerce

As soon as you re-activate the plugin, also make sure to reload the page each time. If the error appears after re-activating a certain plugin, you can identify the plugin that caused the problem. Then, delete that plugin and also report the issue to the plugin author to solve the issue for other WooCommerce users.

4. Switch the active themes

Switching the active theme is another step you can take to fix the 500 internal server error in WooCommerce. The issue might occur sometimes when the theme was updated recently without proper steps. If that’s the case, you can switch your current theme to the default theme or any other WooCommerce theme.

To switch your active theme, go to Appearance > Themes from your WordPress dashboard. You can hover over the available themes and click on the Activate button or add a new theme by clicking on Add New Theme.

fix-internal-server-error-in-woocommerce

As soon as you Activate the new theme, your current theme will be deactivated automatically.

If switching the theme fixed the error, then you definitely know that the problem was with your theme. You should always choose a theme that is compatible with WooCommerce and update the theme properly. Also, make sure to keep a complete backup from the previous theme so you won’t lose any data.

5. Increase PHP memory limit

If you see the 500 internal server error only when you try to login to your WordPress admin or upload an image to your wp-admin, this might be due to a lack of sufficient PHP memory. And the solution is obviously to increase the PHP memory limit.

First of all, check your memory limit using the tool Site Health tool. This tool is available for the WordPress version which is above 5.2.

Go to Tools > Site Health from your WordPress dashboard. Then, open the Info tab where you can find all the details about your site’s health. Now, click on the dropdown of the Server option where you can find the PHP memory limit available on your server.

fix-internal-server-error-in-woocommerce

If the PHP memory is low then you can increase it by editing the wp-config file. We can navigate to the file as we did earlier by logging in to the FTP or Cpanel.

Go to the root folder public-html file where you can find the file wp-config.php. Open the file and look for this code

define( 'WP_MEMORY_LIMIT', '128M' );

The number might differ according to your site memory. If the number is less than 128 MB then you can increase the number. In most cases, 128 MB is enough to store the database.

If you’re unable to find the code then you can paste the code right before the part of the file: “That’s all, stop editing! Happy blogging.

Even though the 500 internal server error is fixed after increasing the memory limit, you might have such issues in the future. You need to find the root cause that is draining your memory limit.

It could be anything from a plugin or even added feature of a newly updated theme. That’s why we would suggest consulting with your hosting provider to look at the server logs to identify the exact issues which help you to troubleshoot the error.

6. Reload the web page

Reloading or refreshing the page is one of the simplest solutions that you can try to fix the internal server error in WooCommerce. Even though such errors are a problem on the webserver but the problem might be temporary. You can reload the web page by clicking on the refresh button in your browser or pressing Ctrl+R.

Sometimes the 500 internal server error might be displayed only on your browser. To check if other users are also having issues with your site then, you can check your site on  Down for Everyone or Just Me.

If the issue is only in your browser then you can clear cache and cookies, if not then you can try some other method.

7. Clear your Browser’s Cache and Cookies

Windows accumulates temporary data on the computer’s storage while operating. Because of the stored data, the browser can download the pages from the cache instead of the internet, which significantly reduces the speed of loading pages.

500 internal server issues may arise if the page is refreshed on the server, and the browser continues to load the old version from the cache. That’s why web pages may not display correctly due to the fact that changes have been made to them, and the browser continues to use outdated data from the cache.

Cookies are service files that store the settings of sites that users have visited. The most common feature is saving passwords, which allows you not to enter a login + password combination every time you enter the site. Depending on the browser, each stores password information for a different time.

A large number of saved cookies leads to a reduction in hard disk space which can also be the reason for internal server errors. Cache and cookies might not be the exact reason for the 500 internal server error. But you can try clearing it out and see if the site loads or not.

Depending on the devices and browsers, the process of clearing cache from the browser might be different. If you are using Windows and your browser is Google Chrome you can see three dots on the top right side of your display. Click on the three dots and you’ll find options to control and customize your browser. Then click on the ‘Settings‘.

Now go ahead and click on Privacy and security. Here, you can see options to clear history, cache, cookies, and more.

You can see checkboxes where you can select and clear history, cache, or cookies. Once you checked the box, click on the Clear Data button.

Even if it doesn’t solve the internal server issues, clearing the cache helps in the performance of your computer, frees up disk space, and also speeds up your WooCommerce store if it is slow.

8. Re-install WordPress

You can restart your whole site by reinstalling WordPress if none of the methods worked for you. But you have to be very careful so that you may not lose any data and also it shouldn’t affect the SEO of your site.

There are many cases where you should reinstall WordPress. The most common one is compatibility issues. WordPress often offers updates for security reasons and due to frequent updates, plugins like WooCommerce may have compatibility issues with WordPress. In that case, it is better to reinstall the other version of WordPress.

If you have access to your WordPress admin, you can reinstall WordPress from your dashboard. To do so, go to Dashboard > Updates and click on Re-install version. The reinstallation will be carried out automatically.

Alternatively, you can reinstall WordPress with the FTP method too. This method is also very straightforward and not complicated at all.

First of all, you need the up-to-date version of WordPress that you can download from the official WordPress.org website.

Just click on Get WordPress and you’ll be redirected to the page from where you can download the latest version of WordPress.

After you download it, unzip the file and extract all the content from the folder.

Make sure to delete the wp-content folder so that we can avoid the overwriting of the same folder in the server.

500-internal-server-error

Now, let’s go to our FTP and upload the files from our downloaded WordPress folder to the root folder which is usually the public or public_html  folder.

Once you upload the file, you’ll get a pop-up that says “Target file already exists”.  A list of actions is also mentioned here where you should select the Overwrite option and then click on OK.

500-internal-server-error

This method reinstalls WordPress without affecting any of your data, themes, and plugins.

9. Update the PHP version

Similar to the themes, plugins, and WordPress itself, make sure that you are using the latest version of PHP or any version which meets the WordPress requirement.

PHP is an open-source programming language used by WordPress. The main purpose of PHP is to process the information of the database and helps to run the functions. It is managed by your web hosting provider which is constantly updated like any other elements like theme, plugins, and WordPress to prevent your website from any vulnerabilities

An outdated PHP version that is not supported by your version of WordPress may cause an internal server error. And also if you’re using an older version of PHP then it might cause conflicts between themes and plugins.

10. Request Support

If you’re still having trouble with 500 internal server errors, contact your hosting provider’s technical support team. They’ll be able to identify the issue and help you determine what kind of assistance you require.

In case the support team takes a long time to respond, you can go to certain forums and ask questions or find the answer from the thread related to your problem.

Conclusion

And that ends our guide on how to fix the 500 internal server error in WooCommerce. If an internal server is not fixed on time, it will affect our ranking in the search engine and sales. But it is not always possible to have our WooCommerce site up and running.

There might be some issues that we can identify and solve as well as there might be issues that cannot be identified and we need professional help. But it is best to implement simple things like updating themes and plugins, clearing cache and cookies, and optimizing our WooCommerce site to avoid such issues in the first place.

Let’s quickly summarize the main points you should have in mind when fixing the internal server error in WooCommerce:

  • Always keep the backup of the site before making any edits to the core file.
  • Choose a reliable host with a good customer support
  • Make sure to use light-weight plugins
  • Always use a theme that is compatible with WooCommerce for your online business
  • Enable auto-updates on themes and plugins

Now, these are certainly not only the methods to fix the internal server issues. We’d love to hear your recommendation and add them to our list. If you tried any of the methods from today’s article and it worked for you, please let us know about your experience in the comment section.

Furthermore, if want to optimize your WooCommerce store then make sure to check out some of our beginner-friendly guides such as: