Hinweis: Sie sind auf den Seiten der Moodle 1.9 Dokumentation. Die Dokumentation der aktuellsten Moodle-Version finden Sie hier: Debugging.


Aus MoodleDocs
Wechseln zu:Navigation, Suche

Baustelle.png Diese Seite ist noch nicht vollständig übersetzt.

Siehe en:Debugging

Debug-Meldungen (Fehlermeldungen) sind als Hilfe für Moodle-Entwickler gedacht. Sobald man bei Problemen mit einer Moodle-Installation in einem Moodle.org-Forum um Hilfe bittet, wird man von einem Moodle-Programmierer eventuell aufgefordert, den Debug-Modus einzuschalten / die Debug-Meldungen zu aktivieren, damit der Grund des aufgetretenen Problems gefunden werden kann.

Inhalt [...]

Aktivieren des Debug-Modus / Einschalten der Fehlermeldungen

Wechseln Sie zur Admin-Ansicht und öffnen Sie "Website-Administration > Server > Debugging". Wählen Sie im Drop-Down-Menü die Option "ALLE:

Location: Administration > Server > Debugging

Debugging messages are intended to help Moodle developers. If you have a problem with your Moodle site and ask for help in a Moodle.org forum, a developer may ask you to turn debug messages on, in order to locate the cause of the problem.

How to turn on debugging

Go into the admin screens, and look under Administration > Server > Debugging. Set the Debug messages to ALL, and Display debug messages to Yes.

Once you have got the error message, and copied and pasted it somewhere, you are recommended to turn debugging back off again.

Debug messages

Moodle1.7 From Moodle 1.7 onwards, further options are provided for controlling how to handle PHP error messages. The administrator can select the types of error messages to be displayed or logged.

The options for debugging include:

  • NONE: Do not show any errors or warnings
  • MINIMAL: Show only fatal errors
  • NORMAL: Show errors, warnings and notices
  • ALL: Show all reasonable PHP debug messages. When you want to find the cause of a problem with your site, this is probably best the setting to use.
  • DEVELOPER: extra Moodle debug messages for developers - If you turn this on, then PHP's error_reporting will be increased so that more warnings are printed. This is almost essential for developers, but not very helpful for anyone else.

Display debug messages

There is an option to choose whether to display error messages or simply record them in the server logs.

Debug email sending

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

Performance info

The Performance info option determines whether performance info will be included in the footer of the standard theme (and some other themes). Performance info includes the time for the page to load, the amount of memory used to generate the page, cpu usage, load, and the record cache hit/miss ration.

If you add define('MDL_PERF', true); define('MDL_PERFDB', true); define('MDL_PERFTOLOG', true); define('MDL_PERFTOFOOT', true); to your config.php file, then it will also count database queries. (This has to be in config.php, because Moodle starts doing DB queries before it loads the config information in the database!

What to do if you cannot get to the admin screens

If the error is stopping you even getting to the admin screens to turn on debugging, then you can set the debugging setting manually.

Try typing the URL directly

The debug settings are at the URL http://.../admin/settings.php?section=debugging on your server. Sometimes that URL will work, even though the pages you need to go to to get there (for example the site front page) do not. So it is worth trying to enter that URL directly.

In config.php

In moodle/config.php you can add the lines:

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

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

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

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';

(If you use a different database prefix, you will need to adjust those commands accordingly.)

See also