Critical Error When Install WooCommerce

When installing WooCommerce, you may meet the issue “There Has Been a Critical Error on Your Website”. Kindly follow these steps to check your issue thoroughly

 

1. Debug

Open your source code via FTP access and adding the following code to the bottom of your wp-config file which is right before “/* That’s all, stop editing! Happy publishing. */”

define('WP_DEBUG', false);
define('WP_DEBUG_LOG', true);

Reload your website and check the debug log in wp-content/debug.log. If it shows as follow, kindly move to the next step

  • Table ‘.wp_actionscheduler_actions’ doesn’t exist
  • PHP Fatal error: Uncaught RuntimeException: Error saving action: Error saving action: Incorrect table name ” in /classes/migration/ActionScheduler_DBStoreMigrator.php:44

According to debug log, the problem comes from WooCommerce Action-scheduler. It seems like new tables are not getting created in the Database.

2. Fix

2.1. Option 1 – Cannot access WPAdmin anymore

Step 1 – Disable WooCommerce Plugin: Log into FTP and change the name of this folder: wp-content/plugins/woocommerce. For example, change to woocommerce-old

Step 2 – Install Action-scheduler Plugin: Now you can access WPAdmin normally. Download, install and active this plugin: https://github.com/woocommerce/action-scheduler

Step 3: Navigate to Tools > Action Scheduled and wait for the tool to fix the issue automatically (about 3-5 mins)

Step 4: After done, refresh your website. Now you can rename your Woocommerce folder again (from woocommerce-old into woocommerce) and reactive it to use normally

2.2. Option 2 – Still can access WPAdmin normally

Navigate to WooCommerce > Status > Scheduled Actions and wait for the tool to fix automatically

After done, refresh your website and turn off the debug log

Debugging in WordPress