I need some help installing Moodle v3.7.2. I've passed all checks for server configuration during installation, except for the fact that the site is recognized as http instead of https, maybe because of the proxy that sits in front of the nginx serving Moodle. Anyway, when I try to load the first page, I receive a generic error:
$string['servererror'] = 'An error occurred whilst communicating with the server';
I've investigated the source code for this error, and found the motivation:
On path /moodle/lib/classes/session/manager.php, row 90, this check fails:
if (!self::$handler->start())
The start() method is simply calling a php function:
session_start();
That returns FALSE and throw the exception. Any idea on how to solve this? Many thanks.
EDIT: I've also tried storing sessions on database:
$CFG->session_handler_class = '\core\session\database';
$CFG->session_database_acquire_lock_timeout = 120;
But with no luck, now the function that fails is:
session_set_save_handler
I have run into the same issue when installing Moodle 3.8 on a Windows-Subsystem-for-Linux (WSL) based Debian development server. Adding the config to switch to database sessions fixed it for me:
$CFG->session_handler_class = '\core\session\database';
$CFG->session_database_acquire_lock_timeout = 120;
I'm thinking that the WSL permissions are problematic when the Moodle data directory falls outside the moodle vhost path, so Moodle cannot read/write properly to the sessions path (yet I do see session files being created). You must delete the browser cookies/restart your browser after setting sessions to the database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With