nativeInstallermoodle

Debug Bitnami LMS powered by Moodle(TM) LMS errors

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

NOTE: The Approach A sections referred to below do not apply to Bitnami native installers. Users of Bitnami native installers should refer only to the Approach B sections.

Troubleshoot domain name errors

You may see an error like the following:

PHP Notice: Undefined index: HTTP_HOST in installdir/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://localhost/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): installdir/moodle/config.php

  • Approach B (Self-contained Bitnami installations): installdir/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 installdir/moodle/admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci
      
    • Approach B (Self-contained Bitnami installations):

        $ sudo php installdir/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): installdir/moodle/config.php

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

  • Restart all services:

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