Set up debugging manually
  • 05 Jul 2023
  • 1 minute to read

Set up debugging manually


Article Summary

In some cases, errors 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 appended with /admin/settings.php?section=debugging

In config.php

In the config.php you can add the following lines:

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

Or even more debugging messages:

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

Remember to remove these lines again once 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 such as 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 following commands:

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


© Copyright 2024 Totara Learning Solutions. All rights reserved. Some content originally obtained via GPLv3 license and continues to be available under GPLv3. All other content is the sole copyright of Totara Learning Solutions. 


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.