Looking for up-to-date Help documentation? Documentation for the latest releases of Totara is now available at totara.help!

Visit the new Help site

All pages

Debugging messages can be enabled by a Site Administrator in Site administration > Development > Debugging.

Debugging messages are intended to help diagnose problems and/or help Totara developers. By default Totara does not show any error messages through the interface. If you are having problems (e.g. blank screens or incomplete screens) turning on debugging is usually the first thing to try.

There are two main settings which control debugging output. Display debug messages controls whether debugging messages are displayed in the interface or just recorded in the server logs. Debug messages determines the severity at which a debugging message is displayed or recorded, or otherwise discarded.

For production sites we recommend setting Display debug messages to No, to prevent debugging messages from being displayed to users. Otherwise, this could make the site vulnerable from a security perspective, as debug messages can give clues to a hacker as to the setup of your site.

We recommend production sites set Debug messages to Minimal or Normal. Minimal will ensure that severe problems are logged. Setting to Normal will ensure that minor problems and notices are also logged, but this may cause the server error log to grow rapidly, potentially filling available disk space. In either configuration, ensure that your server logs are properly configured to be purged when appropriate.

If you have a problem with your Totara site and ask for help, a developer may ask you to turn debug messages on, in order to locate the cause of the problem. If debugging must be reproduced on a production site, it is recommended to only increase the level of debugging by setting Debug messages to All or Developer, then returning the setting to its original value after the debugging messages have been recorded in the site logs. On non-production sites, additionally setting Display debug messages to Yes will allow debugging messages to be displayed directly through the interface.

Debugging settings

You can configure the debugging settings by going to Development > Debugging from the Administration block. Remember to click Save changes once you have made any adjustments. 




Debug messages

These are turned off (set to None) by default. You can choose from:

  • None: Do not show any errors or warnings (default)

  • All: Show all reasonable PHP debug messages

  • Minimal: Show only fatal errors

  • Normal: Show warnings, errors, and notices

  • Developer: Extra Totara debug messages for developers

The Developer level is only recommended if you are a developer, otherwise it is unlikely to have any extra benefits for you but will cause extra load on the server and slow down the site. 

Display debug messages

Set to On, the error reporting will go to the HTML page. This is practical, but breaks XHTML, JS, cookies, and HTTP headers in general.

Set to Off, it will send the output to your server logs, allowing better debugging. The PHP setting error_log controls which log this goes to.


Debug email sending

Determines whether or not to enable verbose debug information during sending of email messages to SMTP server.


Performance info

If enabled performance information will be displayed in the footer (if using the standard theme or some other compatible themes). Performance info includes:

  • CPU usage

  • Page load times

  • Memory used in page generation

You can the following to your config.php file to include database queries:

define('MDL_PERF', true);
define('MDL_PERFDB', true);
define('MDL_PERFTOLOG', true);
define('MDL_PERFTOFOOT', true);


Show origin of language strings

If enabled, language string components and identifiers are displayed when ?strings=1 or &strings=1 is appended to the page URL. This can be helpful for translators.


Show validator links

Enabling this allows links to external validator servers in page footer.

You may need to create new user with username w3cvalidator, and enable guest access.

These changes may allow unauthorised access to your server and therefore you should not enable on any production sites.

Show page information

Enabling this will include page information in the page footer. 


Manually setting debugging

The error could be preventing you from access the screen properly to enable debugging in the administration settings. If this is the case you can enable it manually either via a URL, the config.php file, or in the database. 

URL direct access

If you cannot use the user interface to access the debugging settings then you can try accessing them directly via the URL. Enter your site's URL and then append it with /admin/settings.php?section=debugging

In config.php

In the config.php you can add the lines:

$CFG->debug = 2047;
$CFG->debugdisplay = 1;

Or even more debugging messages:

$CFG->debug = 6143;
$CFG->debugdisplay = 1;

Remember to remove those lines again when you have finished diagnosing your problem.

The following can be used for development debugging but should not be used on production servers:

// Force a debugging mode regardless the settings in the site administration
$CFG->debug = (E_ALL | E_STRICT);
$CFG->debugdisplay = true;

You can specify certain users to always see debugging messages. This is useful on both development and production servers:

// You can specify a comma separated list of user ids that that always see
// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay
// for these users only.
$CFG->debugusers = '2';

In the database

Using a tool like phpMyAdmin, execute the following SQL commands:

UPDATE mdl_config SET value = 2047 WHERE name = 'debug';
UPDATE mdl_config SET value = 1 WHERE name = 'debugdisplay';

To turn it back off, use the admin screens, or the commands:

UPDATE mdl_config SET value = 0 WHERE name = 'debug';
UPDATE mdl_config SET value = 0 WHERE name = 'debugdisplay';
On this page

Provide feedback about this page using the link in the bottom right of this page. 

Still have questions? Why not post them in the forums of the Totara Community?

  • No labels