This documentation relates to CiviCRM version 3.0. It's not maintained anymore.
Current version of documentation.

#usernavbar()

Debugging

Skip to end of metadata
Go to start of metadata

This page refers to outdated version of CiviCRM. Check current version of documentation.


Documentation Search


CiviCRM 3.0 Documentation

Support and Participation

Developer Resources

Return to Global Settings Main Page

Debugging - Enable debugging features including display of template variables and backtracing.

Enable Debugging (in the page Administer CiviCRM / Global Settings / Debugging) - Set this to Yes if you want to use one of CiviCRM's debugging tools. Available debug commands are listed in the info box below.

Security Alert

Debug should NOT be enabled for production sites as it can result in system configuration and authentication information being exposed to unauthorized visitors.

Display Backtrace - Set this value to Yes if you want to display a backtrace listing when a fatal error is encountered. This feature should NOT be enabled for production sites.

Fatal Error Template - Enter the path and filename for a custom Smarty template if you want to define your own screen for displaying fatal errors.

Fatal Error Handler - Enter the path and class for a custom PHP error-handling function if you want to override built-in CiviCRM error handling for your site.

Click Save to save your action or Cancel to cancel it.

If successful you will see the message "Your changes have been saved."

Debug Commands

Debug output is triggered by adding specific name-value pairs to the CiviCRM query string when Enable Debugging is set to Yes:

  • Smarty Debug Window - Loads all variables available to the current page template into a pop-up window. To trigger, add &smartyDebug=1 to any CiviCRM URL query string. Make sure you have pop-up blocking disabled in your browser for the CiviCRM site URL.
  • Session Reset - Resets all values in your client session. To trigger, add &sessionReset=2
  • Directory Cleanup - Empties template cache and/or temporary upload file folders.
    • To empty template cache (civicrm/templates_c folder), add &directoryCleanup=1
    • To remove temporary upload files (civicrm/upload folder), add &directoryCleanup=2
    • To cleanup both, add &directoryCleanup=3
  • Stack Trace - To display a stack trace listing at the top of a page, add &backtrace=1
  • Display Current Session - Displays the current users session variables in the browser, &sessionDebug=1

Two settings that can be set in civicrm.settings.php can be useful in debugging are:
define('CIVICRM_MAIL_LOG', 1); // writes emails to disk, never sends them
define('CIVICRM_MAIL_LOG', '/dev/null'); // emails are thrown away
define('CIVICRM_DAO_DEBUG', 1); // will write out various data layer queries etc that can be useful in debugging

Labels
  • None