CFG error on website

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

I checked cfg dataroot path it’s completely right but when I visit my site it’s showing this type of error. How can I solve it??

No idea. You have to provide more info

5 Likes

Hi @rajgupta6969,

From the error message, I guess you’re trying to install the learning platform moodle on your free hosting.

Most cases that I encounter regarding this error message are something related to your config.php needing to check the absolute path set in $CFG->dataroot, or it’s permission settings.

This link on the moodle support forum may be of help:
https://moodle.org/mod/forum/discuss.php?d=370441

Let us know how things went.

Cheers!

3 Likes

yes , you are right. i installed moodle using softaculous installer. its working fine but suddenly its showing this error and i can’t solve it. i also checked config.php path and moodledata folder permission but its still not working.

hello, i need help about this problem -
Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

i installed moodle using softaculous installer but this error show everytime. i delete everything from my website and install it again and same error showing. i tried to host other html files its working find but this moodle is not working. i also checked config.php and path of dataroot there is no issue. and also giving moodle folder permission 777. idk what is the issue please check it what is issue.

here some images:
1
image
2


3
image

Dataroot has to be inside htdocs folder, anything outside htdocs is inaccessible by the php program.

5 Likes

Moodle is a bit tricky to work with. As said above by @Ziverre, the moodledata folder needs to be inside htdocs, so the last part of $CFG->dataroot needs to also be configured to /htdocs/moodledata instead of just /moodledata:

There’s a chance you may face an issue with the default session storage setting as well, in which case you also need to follow the steps here:

6 Likes

i tried but after moving moodledata folder in htdocs and changed path in cofing.php (/home/vol6_4/epizy.com/epiz_33844728/htdocs/moodledata’) its showing new error on website.

image

is there any other way to get access folder outside of htdocs folder or run moodle on free hosting?

Hi rajguota6969,

This simply means moodle has thrown an Exception somewhere in their code, you might want to check with the error log if you have enabled this in your php settings.

Cheers!

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.