dataroot is not configured properly error

dataroot is not configured properly error

by kate anderson -
Number of replies: 3

Mahara, XAMPP, and database all installed on my Windows 7 laptop, without issue.

Moodle 2.5 Installation broke at the database installation point with an error message - couldn't create database.

I checked the config file and it transpired that no file had been created from the config distribution.

I created a config file with the following data:

$CFG->dbtype = 'mysql5';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'admin';
$CFG->dbpass = '';
$cfg->wwwroot = 'localhost/moodle/htdocs/';
$cfg->dataroot = 'c:\\xampp\\htdocs\\moodle';

I am now getting this error, can anyone shed any light on this for me?

Warning: Creating default object from empty value in C:\xampp\htdocs\moodle\config.php on line 57
Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

Thanks in advance

Average of ratings: -
In reply to kate anderson

Re: dataroot is not configured properly error

by Jaswinder Singh -
Picture of Testers Picture of Translators

Hi Kate,

According to Moodle docs,  For security purposes, it is CRITICAL that moodledata directory is NOT accessible directly via the web.

which means that you should not keep your moodledata directory in \htdocs folder. It can be placed under c:\\xampp\\moodledata\\moodle

Else if you want to use it in \htdocs directory only, then you can protect the access from .htaccess file in moodledata folder.

In reply to Jaswinder Singh

Re: dataroot is not configured properly error

by kate anderson -

Hi Jaswinder,

Thankyou for responding.  I began the whole process again and I now have Moodle installed.

Kate

In reply to Jaswinder Singh

Re: dataroot is not configured properly error

by Luis de Vasconcelos -
Picture of Particularly helpful Moodlers

On Windows it should probably be single slashes:

$cfg->dataroot = 'c:\\xampp\moodledata\moodle';