- 06 Aug 2024
- 1 minute to read
Set up debugging manually
- Updated on 06 Aug 2024
- 1 minute to read
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';