Guide

WooCommerce PHP errors: how to find them and read the error log

PHP errors happen on your server, and WordPress keeps them in three places. Where to look, how to read what you find, and which errors are worth fixing first.

Updated

The short answer

PHP errors happen on your server, and WordPress keeps them in three places:

  • WooCommerce → Status → Logs — the fatal-errors log and your payment gateway's log;
  • wp-content/debug.log — warnings and notices, once WP_DEBUG_LOG is on;
  • your host's error log — in the hosting control panel.

The file path in each error names the plugin or theme responsible. Fix fatal errors and anything on the checkout first; most notices can wait.

The kinds of PHP error

  • Fatal error — the request stopped. On a page, shoppers see “There has been a critical error on this website” or a blank screen; in the background, a checkout that never completes.
  • Warning — something went wrong and PHP carried on. The page may work, or may be missing part of what it should show.
  • Notice and deprecation — code that works today but is written in a way PHP or WordPress plans to stop supporting. Mostly harmless, and the most numerous by far.

Where to find them

  1. WooCommerce → Status → Logs. Pick the fatal-errors source for fatal errors, and your payment gateway's source for payment problems.
  2. The WordPress debug log. In wp-config.php, set:
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    Errors are then written to wp-content/debug.log and never shown to shoppers.
  3. Your host's error log, usually in the hosting control panel — useful when WordPress itself can't start.
  4. The recovery-mode email. After a fatal error, WordPress usually emails the site's admin address with the plugin or theme responsible and a link to log in with it paused.

Reading an error

A PHP error line has a type, a message, a file and a line:

PHP Fatal error: Uncaught Error: Call to undefined function foo()
in /wp-content/plugins/some-plugin/includes/class-cart.php:142
  • /wp-content/plugins/<name>/ is that plugin; /wp-content/themes/<name>/ is the theme; /wp-includes/ or /wp-admin/ is WordPress, usually called wrongly by something else further down the stack.
  • Allowed memory size exhausted — the request needed more memory than allowed. Raise WP_MEMORY_LIMIT, and look for the plugin that needs it.
  • Call to undefined function or class not found — a plugin depends on another one that is missing, inactive or out of date.
  • Errors that start right after a PHP upgrade — a plugin or theme not yet compatible with the new PHP version.

When the error is on the checkout

A fatal error while an order is being placed rarely shows the shopper a clear message. The checkout spins, or returns a generic error, and the order may or may not exist. If shoppers report a checkout that never finishes, look in the fatal-errors log for entries at the times they tried, and read the gateway's log beside it.

Collecting them with StorePilot

  • Fatal errors and uncaught exceptions are reported from every plugin, the theme and WordPress itself, grouped into issues with the file, line and stack.
  • Warnings and notices only from the plugins you choose to watch, so the issue list isn't buried in other people's deprecations.
  • The checkout behind it. A fault while a classic WooCommerce checkout is placing an order is linked to that shopper's visit and its recording.
  • Failures your code handles — a shipping rate API that silently falls back — can be reported on purpose with storepilot_capture().
  • Alerts for new errors and spikes, by email, Slack, Telegram or webhook.

Install the WordPress plugin, see how error tracking works, or read about PHP errors in the docs.

FAQ

Questions about this guide

Where is the WooCommerce error log?

In WordPress, under WooCommerce → Status → Logs. The fatal-errors log holds PHP fatal errors WooCommerce caught, and payment gateways and other extensions write their own logs there too. PHP's own warnings and notices go to wp-content/debug.log when WP_DEBUG_LOG is switched on.

What does "There has been a critical error on this website" mean?

A PHP fatal error stopped the page. WordPress usually emails the site's admin address with the plugin or theme responsible and a recovery-mode link that lets you log in with it paused. The fatal-errors log in WooCommerce → Status → Logs has the details.

Is it safe to turn on WP_DEBUG on a live store?

Yes, if errors are written to the log and not shown on the page: set WP_DEBUG and WP_DEBUG_LOG to true and WP_DEBUG_DISPLAY to false. Showing errors to shoppers can break the checkout and reveal file paths.

Do I need to fix every PHP warning and deprecation notice?

No. A busy store logs many notices from plugins you didn't write, and most change nothing for shoppers. Fatal errors, and anything on the cart, checkout or payment requests, come first.

Hear about a fatal error before your customers do

Install the plugin, and PHP errors arrive grouped, with the plugin responsible and the checkout they broke.

Start for free

Every feature on the Free plan, for 100 visitors a month. No card required.

Choose a plan

Plans from €29 a month, priced by your monthly visitors and the websites you connect.