Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Heather P -
Number of replies: 11

Hello

I am on Windows Server 2016 with IIS 10 and trying to install a brand new Moodle, a 3.4 version. This time I'm going for Microsoft SQL on a separate server and the data folder is also not on the same server. They have set me up a sym link to reach the data folder as simply using the network location would not work, something about the php not liking it.

I've got past the first hurdle with permissions issues and now I am getting this.

Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

The thing is when I look in the data folder, there was nothing in there and now there is, so clearly it has at some point found the data folder and put in the folders for cache, lang, localcache, temp so now I really don't understand.

If it didn't have anything in there I would believe I had misdirected it or similar, but clearly it is getting there and it does have write and modify permissions so what else am I looking for to have misconfigured it please.

Thank you

Heather

Average of ratings: -
In reply to Heather P

Re: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Nitesh Kumar -

Hi Heather,

Please check the config.php file and check the $CFG->dataroot variable. it should have the absolute path to your Moodle data.


If dataroot is configured properly and moodle data exists then please run the below-mentioned command using command line.

chown -R www-data:www-data yourmoodledataname


Hope this will help.

In reply to Nitesh Kumar

Re: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Heather P -

Hi

the config.php file did and still does look absolutely right.

Unfortunately it is Windows that I'm using and I have absolutely no idea what the Windows  equivalent of ownership is.

It has appropriate read write modify execute.

Thank you

Heather

In reply to Heather P

Re: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Heather P -

For info in case anyone else gets a similar issue.

It was the php doing a bizarre check on the symlink that was causing it to throw a fatal error.

Regards

Heather

In reply to Heather P

Re: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Heather,
could you elaborate what PHP was doing wrong in your env?

If you're able to describe the steps to replicate your issue, we could file it into the Tracker to (try to) find a fix in Moodle for a next release.

TIA,
Matteo

In reply to Heather P

Re: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Heather

You wrote:
> I have absolutely no idea what the Windows equivalent of ownership is.

Does is surprise you that something you don't understand throws hard questions? I'm just curious.
wink
In reply to Heather P

Re: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Luis Alvarez Díaz -

The 

$CFG->dataroot  = '/Applications/MAMP/data/moodle34'  does not exist. What I must do?


In reply to Luis Alvarez Díaz

Re: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Is the folder in that location?  If not, create it or move it to that location...

In reply to Emma Richardson

Re: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Luis Alvarez Díaz -
Thank you

The folder was not in the appropiate location



I appreciate your help, I am new and I am very interested to study and know

Moodle application. I will appreciate your help from now on



Bye





Luis Adelmo Alvarez





On Thu, May 10, 2018 at 9:28 PM, Emma Richardson (vía Moodle.org) <
In reply to Luis Alvarez Díaz

Re: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Nitesh Kumar -

Please create a moodledata folder outside the moodle folder and set the absolute path of moodledata folder in config.php. 

for example - 

$CFG->dataroot  = '/var/www/html/moodledata';

Average of ratings: Useful (2)
In reply to Nitesh Kumar

Re: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

by Luis Alvarez Díaz -
Thank my friend

I dit it, and it work



I appreciate your help, I am new and I am very interested to study and know

Moodle application. I will appreciate your help from now on



Bye



Luis Adelmo Alvarez





On Fri, May 11, 2018 at 7:10 AM, Nitesh Kumar (vía Moodle.org) <