Hinweis: Sie sind auf den Seiten der Moodle 3.2 Dokumentation. Die Dokumentation der aktuellsten Moodle-Version finden Sie hier: Fehler FAQ.

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


Fehler: Database connection failed

Wenn Sie die Fehlermeldung "database connection failed" oder "could not connect to the database you specified" erhalten, dann hat das verschiedene Ursachen und es gibt entsprechende Lösungen.

  • Ihr Datenbank-Server inst nicht richtig installiert oder läuft nicht. Um dies z.B. für den MySQL-Datenbank-Server zu prüfen, geben Sie auf der Kommandozeile folgendes ein:
  $telnet database_host_name 3306
Sie sollten eine Meldung bekommen, in der u.a. die Version des MySQL-Servers angezeigt wird.
  • Wenn Sie 2 Moodle-Instanzen auf verschiedenen Ports laufen haben, verwenden Sie in der Moodle-Konfigurationsdatei config.php in der Variablen $CFG->dbhost die IP-Adresse des Servers (nicht "localhost") und den Port:
  $CFG->dbhost = 127.0.0.1:3308.
  • Prüfen Sie, ob Sie die PHP-Erweiterungen für MySQL (oder PostgresSQL) installiert haben.
  • Sie haben keine Moodle-Datenbank und/oder keinen Moodle-Datenbanknutzer angelegt mit den passenden Rechten für den Zugriff auf die Moodle-Datenbank.
  • Die Moodle-Datenbank-Konfiguration in der Moodle-Konfigurationsdatei config.php ist nicht korrekt. Verwenden Sie phpMyAdmin, um die Konfiguration Ihrer Moodle-datenbank und des Moodle-Datenbanknutzers vorzunehemn und zu prüfen.
  • Stellen Sie sicher, dass im Moodle-Datenbanknamen und im Passwort keine Sonderzeichen verwendet werden.
  • Sie verwenden eine MySQL-Version 4.1 oder neuer, aber die PHP-Erweiterungen für MySQL sind älter als 4.1 (siehe PHP-Informationen). In diesem Fall funktioniert der Algorithmus zum Verschlüsseln von Passwörtern nicht. Verwenden Sie folgenden MySQL-Befehl, um die Passwörter auf das alte Verschlüsselungsformat zurückzusetzen:
mysql>SET PASSWORD FOR 'root'@'localhost' = OLD_PASSWORD('password');
mysql>SET PASSWORD FOR 'moodleuser'@'localhost' = OLD_PASSWORD('password');
Am besten Sie aktualisieren Ihre PHP-Erweiterungen für MySQL. Siehe MySQL Document für weitere Informationen.
  • Sie verwenden Fedora Core 3 oder ein anderes Linux-System mit installiertem und aktiviertem SELinux. Siehe SELinux deaktivieren. Wenn Sie SELinux nicht deaktivieren wollen, dann müssen Sie httpd-Prozessen erlauben, Netzwerk-Verbindungen aufzubauen:
setsebool httpd_can_network_connect true

  • Mac OSX: Wenn Sie MySQL unter Mac OSX laufen haben, dann probieren Sie, in der Moodle-Konfigurationsdatei config.php die Variable $CFG->dbhost' von localhost auf 127.0.0.1 zu ändern.

Siehe auch: MySQL-Seite Typische Fehler.

Ich kann mich nicht anmelden: Fehler "Please verify that the current setting of session.save_path is correct"

Dieser Fehler tritt auf, wenn PHP Probleme beim Speichern der Session-Dateien hat. Dann könnten auch folgende Fehlermeldungen auf Ihrem Bildschirm oder in Ihren Log-Dateien erscheinen:

Warning: Unknown: open(some-path/sessions/sess_acbf942a7399db3489ffa910e35d5242, O_RDWR)
failed: Permission denied (13) in Unknown on line 0
Warning: Unknown(): open(some-path/sessions/sess_acbf942a7399db3489ffa910e35d5242, O_RDWR) 
failed: No space left on device (28) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current 
setting of session.save_path is correct (some-path/sessions) in Unknown on line 0 

Dann ergänzen Sie (temporär) in der Moodle-Konfigurationsdatei config.php folgende Zeile:

$CFG->dbsessions = true;

Datenbank-Sessions können Ihre MySQL-Datenbank überlasten, sie eignen sich nicht für verteilte Umgebungen. Wenn die obige Ergänzung das Anmelde-Problem löst, dann sollten Sie folgendes tun:

  • Zugriffsrechte prüfen: Der Webserver-Nutzer muss auf den session.save_path zugreifen können. Das können Sie mit folgendem Befehl prüfen:
chown -R apache:apache moodledata/sessions
Hierbei setzen wir voraus, dass der Webserver-Nutzer apache heißt.
  • Setzen Sie die Rechte für dieses Verzeichnis zunächst auf 0777 (jeder darf lesen, schreiben und ausführen):
chmod -R 0777 some-path/sessions
Wenn dies das Problem löst, schränken Si die Zugriffsrechte ein (Empfehlung: 700).

Fehler: A server error that affects your login session was detected

Wenn Sie Ihren Browser neu starten und danach das Anmelden in Moodle nicht mehr funktioniert, dann lesen Sie diesen Diskussionsbeitrag im Kurs Using Moodle auf moodle.org (englisch).

Wenn Ihnen das auf der Community-Seite moodle.org passiert, dann kann es sein, dass Moodle gerade aktualisiert wird. Versuchen Sie es später noch einmal oder melden Sie das Problem im Bug-Tracker.

Fehler: Failed opening required '/web/moodle/lib/setup.php'

In der Moodle-Konfigurationsdatei config.php muss die Eintragung für die Variable $CFG->dirroot der vollständige Server-Pfad des Verzeichnisses sein, in dem Ihr Moodle installiert ist.

Manchmal werden dort fälschlicherweise relative Pfade eingetragen.

Fatal error: Parse error, call to undefined function: get_string()

Wenn Sie solche Fehlermeldungen sehen:

Parse error: parse error, unexpected T_VARIABLE in /path/to/moodle/config.php on line 94 
Fatal error: Call to undefined function: get_string() in /path/to/moodle/mod/resource/lib.php
on line 11

dann haben Sie vermutlich in der Moodle-Konfigurationsdatei config.php ein Semikolon oder schließende Anführungszeichen vergessen (vor Zeile 94).

Eine andere Möglichkeit könnte sein, dass Sie die Konfigurationsdatei in einem Textverarbeitungsprogramm, wie z.B. MS Word editiert haben und als HTMl-Seite gespeichert haben. Verwenden Sie stattdessen einen einfachen Text-Editor, wie z.B. Notepad.

Wenn Sie zusätzliche Plugins verwenden, prüfen Sie, ob die zugehörigen PHP-Skripte evtl. Abkürzungen wie <? ?> anstelle von <?php ?> verwenden. Informieren Sie in diesem Fall die zuständigen Entwickler/innen über das Problem. Ersetzen Sie dann die Abkürzungen durch die normalen Tags oder ergänzen Sie in der PHP-Konfigurationsdatei php.ini folgende Zeile:

short_open_tag = On

Im Kernpaket von Moodle werden Sie normalerweise keine Abkürzungen finden. Falls dies doch der Fall sein sollte, erstellen Sie bitte einen Eintrag im Bug-Tracker.

When I go to the admin page, I get told to make dirroot blank!

If you see errors like this:

Please fix your settings in config.php: 
You have: $CFG->dirroot = "/home/users/fred/public_html/moodle"; 
but it should be: $CFG->dirroot = "";

then you have encountered a small bug that occurs on some servers. The problem is with the error-checking mechanism, not with your actual path. To fix it, find this line (line 66) in the file admin/index.php:

if ($dirroot != $CFG->dirroot) {

and change it to this:

if (!empty($dirroot) and $dirroot != $CFG->dirroot) {

Why do I keep getting error messages about "headers already sent"?

If you see errors like this:

Warning: Cannot add header information - headers already sent by 
(output started at /webs/moodle/config.php:87) in /webs/moodle/lib/moodlelib.php 
on line 1322 
Warning: Cannot add header information - headers already sent by 
(output started at /webs/moodle/config.php:87) in /webs/moodle/lib/moodlelib.php 
on line 1323 
Warning: Cannot add header information - headers already sent by 
(output started at /webs/moodle/config.php:87) in /webs/moodle/login/index.php 
on line 54

you have blank lines or spaces after the final ?> in your config.php file. Sometimes text editors add these - for example Notepad on Windows - so you may have to try a different text editor to remove these spaces or blank lines completely.

Fehler: "500:Internal Server Error"

There are several possible causes for this error. It is a good idea to start by checking your web server error log which should have a more comprehensive explanation. However, here are some known possibilities....

1. Syntax error: There is a syntax error in your .htaccess or httpd.conf files. The way in which directives are written differs depending on which file you are using. You can test for configuration errors in your Apache files using the command:

#apachectl configtest

2. PHPsuexec: Your server does not support .htaccess files, especially if it is running PHPsuexec, which is an Apache module used for increasing the security of a site on a hosted system. In this situation:

- you may also see a 403: Forbidden error.

- the webserver executes under your own username and all files have a maximum permissions level of 755. Check that this is set for your Moodle directory in your control panel or (if you have access to the shell) use this command:

#chmod -R 755 moodle

- use a PHP.INI file instead of a .htaccess in the directory where the Moodle PHP script is being executed. For example: if you are receiving a memory exhausted error when your server is executing the file moodle/admin/cron.php, use a PHP.INI file to change your memory_limit and copy it to the moodle/admin directory. Remember that for PHP4, PHP.INI files are per-directory, so you'll need to copy it to each sub-directory. If you are using PHP5 or higher on a shared host, check with your host on whether they support custom PHP.INI files, and how to create them. The syntax used in a PHP.INI file is different from a .htaccess file and you need to take out php_value/php_flag at the beginning of the line and use an equals sign to assign a value, e.g.

php_value memory_limit 128M <-- .htaccess
memory_limit = 128M         <-- php.ini equivalent 

3. Incompatible directive: You may have a directive in your .htaccess or httpd.conf files which are not compatible with your web server version. Check your webserver documentation.

Fehler: "403: Forbidden"

Check your webserver configuration. See also the section above "500:Internal Server Error".

Fatal error allowed memory size exhausted. How do I increase my php memory limit?

You will sometimes see an error message something like this:

Fatal error: Allowed memory size of 67108864 bytes exhausted 
(tried to allocate xx bytes) in /var/www/moodle/yyyy.php

This error means that the php memory_limit value is not enough for the php script. The memory_limit value is the "allowed memory size" - 64M in the example above (67108864 bytes / 1024 = 65536 KB. 65536 KB / 1024 = 64 MB). You will need to increase the php memory_limit value until this message is not shown anymore. There are two methods of doing this.

  • On a hosted installation you should ask your host's support how to do this. However, many allow .htaccess files. If yours does, add the following line to your .htaccess file (or create one in the moodle directory if it does not already exist):
php_value memory_limit <value>M
Example: php_value memory_limit 40M
  • If you have your own server with shell access, edit your php.ini file (make sure it's the correct one by checking in your phpinfo output) as follows:
memory_limit <value>M
Example: memory_limit 40M
  • For later versions of Moodle you could be looking at figures in the region of 512M for all functions to work properly (backup and restore are particularly memory hungry). It is sensible to monitor the memory usage on your server if using these large settings.

Remember that you need to restart your web server to make changes to php.ini effective. An alternative is to disable the memory_limit by using the command memory_limit 0.

Fehler: "Your session has timed out. Please login again." or "The page isn't redirecting properly" or "This webpage has a redirect loop"

Please do one/all of the following:

  • Try deleting cookies manually from your browser and close it down, then access your site again. Sometimes this clears up the problem.
  • Check that your moodledata/sessions directory has write permissions. When you access Moodle a new file should be created there.
  • If you are running two versions of Moodle on the same computer, set a cookie prefix in Administration > Server > Session handling.

The discussion Your session has timed out. Please login again has further suggested solutions:

  • Browse to: http://yoursite/subdir/admin/purgecaches.php , it should prompt you to login first and then redirect to a page that has a button to purge all caches.
  • If you can access your server files, go to the 'moodledata' folder, go to the 'cache' folder inside and erase all the contents there (usually only two files). Moodle will delete the frozen session with the redirect loop and Moodle will work again.

Fehler: Maximum execution time of 30 seconds exceeded in...(when installing)

  • Your computer is taking too much time to execute the installation scripts.
  • Press F5 (refresh) until it finishes the installation process.

How can I fix just one bug, without upgrading my whole site?

Suppose:

  • You are running an older Moodle version.
  • You are experiencing a particular bug.
  • You have searched in the tracker, and found that your problem is MDL-abc, and that it has been fixed in the latest version.
  • For some reason, you cannot upgrade your whole site, even though the latest version probably has security fixes.

Then, how can you get the fix for just this one bug, without upgrading your whole site? Well, if you are prepared to manually patch the code, you can probably get this information from the tracker. Please see this guide.

error/moodle/cannot finish ui if not setting ui

An occasionally reported intermittent error that may or may not be related to the php ini value of max_execution_time. So far proven intractable, as it has not been found to have a consistent cause and cannot be consistently duplicated.


Siehe auch