FLUIDHOST

Upgrading to Moodle 5.1

Ever since Moodle released v5.1 many Moodle admins have been wanting to upgrade but facing issues due to the directory structure change in Moodle which requires the document root of the domain to be ending in /public which is not possible to change in most of the cases unless you are good at or have access to modifying Apache virtual host configuration.

Common Errors in Moodle 5.1

Failure to do so you might face errors like :

  • Incorrect $CFG->wwwroot in config.php. It should not end in /public
  • PHP Warning:  Undefined property: stdClass::$libdir in /moodle/lib/setup.php on line 26

Should Installing/Upgrading Moodle be this Complex ?

Installing or Upgrading Moodle (especially with Moodle 5.1) has sometimes been a challenge if you are not a developer or system admin. Ideally you should be able to setup Moodle and get going in less than 5 minutes no matter it is an install or upgrade.

Workarounds

We have come across several workarounds on Moodle community forums. However is it safe to use those workarounds ?

  • $CFG->wwwrootendsinpublic = false;
    This workaround is not safe to use in production environment. Moodle itself recommends this only for local/development environments where you do not have access to change the document root
  • Add a redirect in the document root to redirect to /public
    Now this generally works but do you really want your Moodle installation URL to always show a /public ? Most users don't want this.
    It also poses a security risk since Moodle saves sensitive files in the directory above /public and since in this case that directory is web accessible it does pose a security risk.

Solution

We at Fluidhost have been managing several Moodle installations for our customers including upgrades for Free. We are experienced in Moodle management for more than 5 years. If you are already our customer reach out to us at [email protected] and we will help you asap.

Not hosting with us yet ? Not a problem. We would like to help you even if you are not hosting with us but with a small fee. Reach out to our team at [email protected]