bchmoodle

Debug Bitnami LMS powered by Moodle(TM) LMS errors

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

Troubleshoot domain name errors

You may see an error like the following:

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

To resolve this, specify your domain name or IP address in the Moodle(TM) LMS configuration file as shown below:

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

NOTE: Depending on your installation type, the Moodle(TM) LMS configuration file will be located in the following paths:

  • Approach A (Bitnami installations using system packages): /opt/bitnami/moodle/config.php

  • Approach B (Self-contained Bitnami installations): /opt/bitnami/apps/moodle/htdocs/config.php

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, depending on your installation type:

    • Approach A (Bitnami installations using system packages):

        $ sudo php /opt/bitnami/moodle/admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci
      
    • Approach B (Self-contained Bitnami installations):

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

    $CFG->dboptions = array(
      ...
      'dbcollation' => 'utf8mb4_unicode_ci',
      ...
    );
    

    NOTE: Depending on your installation type, the Moodle(TM) LMS configuration file will be located in the following paths:

    • Approach A (Bitnami installations using system packages): /opt/bitnami/moodle/config.php

    • Approach B (Self-contained Bitnami installations): /opt/bitnami/apps/moodle/htdocs/config.php

  • Restart all services:

    $ sudo /opt/bitnami/ctlscript.sh restart
    
Last modification June 16, 2021