azuremoodle

Debug Bitnami LMS powered by Moodle™ LMS errors

Troubleshoot domain name errors

You may see an error like the following:

PHP Notice: Undefined index: HTTP_HOST in /opt/bitnami/moodle/config.php

To resolve this, specify your domain name or IP address in the /opt/bitnami/moodle/config.php Moodle(TM) LMS configuration file as shown below:

$CFG->wwwroot   = 'http://SERVER-IP/moodle';

Change database encoding to UTF-8

You may see an error like this:

The current setup of MySQL or MariaDB is using 'utf8'. This character set does not support four byte characters which include some emoji. Trying to use these characters will result in an error when updating a record, and any information being sent to the database will be lost. Please consider changing your settings to 'utf8mb4'. See the documentation for full details."

To resolve this, follow the steps below:

  • Log in to the Moodle(TM) LMS server and run the command below at the server console:

      $ sudo php /opt/bitnami/moodle/admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci
    
  • Modify the /opt/bitnami/moodle/config.php Moodle(TM) LMS configuration file to reflect the new encoding by updating the $CFG->dboptions variable as shown below:

    $CFG->dboptions = array(
      ...
      'dbcollation' => 'utf8mb4_unicode_ci',
      ...
    );
    
  • Restart all services:

    $ sudo /opt/bitnami/ctlscript.sh restart
    
Last modification February 9, 2023