Moodle V5.1 and Moodle V5.1.1 scripts break the Moodle installation

Moodle has introduces new “securities” that require the public HTML to be inside the Moodle folder. The script currently puts the updated Moodle files in /public_html. The installation breaks the new Moodle install. More details:

The error “moodle 5.1.1 Stack trace:line 26 of /index.php: core\exception\moodle_exception thrown” in Moodle 5.1.1 is typically caused by

incorrect web server configuration related to the new /public directory.

Moodle 5.1 introduced a major change in its file structure for security reasons. Your web server’s document root is likely still pointing to the main Moodle folder instead of the new, dedicated /public directory.

Solution Steps

To resolve this issue, you must update your web server’s configuration:

1. Locate the Moodle installation path: Identify the full path to your Moodle installation directory (e.g., /var/www/html/moodle).
2. Adjust the Document Root: Change your web server’s configuration so that its document root points specifically to the /public subdirectory within your Moodle installation (e.g., /var/www/html/moodle/public).
3. Restart the Web Server: After saving the configuration changes, restart your web server (e.g., Apache, Nginx) for the changes to take effect.
4. Clear Browser Cookies (Optional): Sometimes old session cookies can cause issues; trying to clear your browser’s cookies manually may help.

I hope the issue can be fixed soon.

Warm regards,
Rob Oudendijk

1 Like

I will have to take a closer look at it. Thanks for the heads up!