Finding PHP Error Logs in WooCommerce / Hosting Server

PHP error logs are very useful when investigating an issue on WordPress and WooCommerce sites. This documentation provides steps and information on how to access the PHP error logs either within WooCommerce or on a hosting server.

WooCommerce fatal errors log

WooCommerce 3.2 introduced a log that displays PHP fatal errors. This log can contain relevant information that would be found in the PHP error logs. Begin with this before moving to find PHP logs on the server.

Steps to access the WooCommerce fatal errors log:

  1. Go to WooCommerce > Status > Logs
  2. Choose a log from the drop-down labeled fatal-errors.log
  3. Click on View

Refer to the below example image for the fatal errors log.

php error logs fatal errors log example

This log catches PHP fatal errors, runtime errors, and errors purposely triggered in the code by a PHP function. Runtime errors can occur when there is a typo in the code, for example.

Fatal errors occur when the action in the code cannot be completed. Examples include:

  • Calling an undefined function
  • Using an undefined variable
  • Calling a function on a null or otherwise unusable variable

This error does not include web server errors, such as timeouts.

The log will include the:

  • Timestamp when the error occurred
  • Error that occurred
  • File and line in the code for the origination of the error
  • Stack trace – a snapshot of the history of the function calls and files leading up to the error

Plugin specific error

Sometimes a plugin generates a log file specific to it for the error/issue you are facing. Here’s how you can locate and share it to StoreApps support.

Let’s consider Affiliate for WooCommerce plugin as an example here.

Follow these steps:

  1. Go to WooCommerce > Status > Logs
  2. Click on the dropdown and look for the log file named affiliate-for-woocommerce-... .log with today’s date/date when the error occurred.
  3. Copy the log file content and send it to StoreApps support

Error related to StoreApps connector for plugin updates

This is applicable for the plugins you purchased from StoreApps.org. In case, StoreApps connector for plugin updates is not working, follow the below steps:

  1. Go to WooCommerce > Status > Logs
  2. Click on the dropdown and look for the log file named storeapps-upgrade-... .log with today’s date/date when the error occurred.
  3. Copy the log file content and send it to StoreApps support

PHP error logs on the server

You may find the PHP error logs in a few possible places on the server. These may include:

  1. in your server’s root folder, called error.log
  2. in public_html or similar folder, called error.log
  3. in var/logs or similar, error.log
  4. additionally, if you have debugging enabled in WordPress and you have it saved to a file, it will be in the wp-content folder, and called debug.log

If you’re having trouble finding the file, you can have PHP tell you where it is:

  1. Create a file named phpinfo.php in the root of your WordPress’s directory
  2. Open the phpinfo.php file in a text editor
  3. Insert the following code into the file: <?php phpinfo(); ?>
  4. Open the file on your site. For example, if your site’s URL is test.com, you can open the file by visiting – https://test.com/phpinfo.php
  5. Search the page for the error_log value. The file path listed here is the absolute file path of the PHP error log – visit that address on your server and you should find the PHP error log. If the value is empty, then you need to set a value to log errors on your site. See the below image for how it should look like:
PHP info output example

Reporting the error

Upload the error log file on Google Drive, DropBox, or any other app you are using and share the link via email with the support.

Article reference – WooCommerce.com

Still need help? Contact us