Trying to get Moodle on server: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

Asked by:
mexlobo / 5 Points
Time:
2012-07-01 1:52 am EST
Category:
Moodle
Hits:
47,183
Using xampp, filezilla, byethost.com

Looks like im almost in the last of the steps, but i get this

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


Ive tried everything in config.php and nothing is working...

Is there a way to give someone access so they can fix it?




59 seconds agoEugenio Lobo
dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'sql203.byethost7.com';
$CFG->dbname = '******_moodle1';
$CFG->dbuser = '******';
$CFG->dbpass = '*****;
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbsocket' => 0,
);

$CFG->wwwroot = 'http://rosy.byethost7.com/';
$CFG->dirroot = '/home/vol6/byethost7.com/b7_10900438/htdocs/moodle';
$CFG->dataroot = '/home/vol6//b7_10900438/public_html/moodledata';
$CFG->admin = 'admin';

$CFG->directorypermissions = 0777;

$CFG->passwordsaltmain = 'O-Ovjp[Sr+Xnb,Y`C R(^Hl78*I';

require_once(dirname(__FILE__) . '/lib/setup.php');

// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!

To ask this user for more information, please first login.

To submit an answer, please login.

ANSWERS

0

ScottM
Staff
16,266 Points
2012-07-02 5:27 pm EST
Hello mexlobo,

The dataroot path may be incorrect or have the wrong permissions. I cannot tell for sure as I cannot locate an account for you on our servers. If I could, I would be able to check the exact path.

On our servers, 777 permissions can sometimes create errors due to server security. If you are certain that dataroot path is correct, then I would try a 755 permission setting if you are still getting the errors.

I hope this answers your question. If you have any more questions or information specific to the issue please leave a comment below so we can further assist you.

Best Regards,
Scott M

To submit a comment on this answer, please first login.

0

ostachio
2017-06-21 1:15 am EST
okay, took me a long time to get something working, but I at least am able to use my Moodle3.0 install.

First problem is that not enough information is giving to even begin identifying this issue:
"Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting."

is just telling you --- whoops, error found --- go and figure it out yourself --- idiotHUMAN...

Playing around in the CPanel, figured out a way to get more feedback on this "general" type of error...
In the CPanel
--> Alter PHP Config
--> select the domain/subdomain where you installed Moodle
--> for "Display Errors" --- switch it "ON"
--> click "Alter PHP directives"

this actually changes a ".htaccess" file that's specifically found in your Moodle install website folder, and tells the php engine to output more error information.

... wait, still not even close to finishing ...

try to open your Moodle webpage again...
it will still include the earlier error, but now you should see another message starting off like:
"Warning: realpath(): open_basedir restriction in effect. ...."

That's a variable ("open_basedir"), that you find in "php.ini" , that needs to have the file path of your "moodledata" folder included.
How to modify "php.ini" from ByetHost's CPanel??? Couldn't figure it out. And I'm sure it has something to do with ".htaccess" ---- but whoops, not in the mood to fiddle with ".htaccess".

So the next useful thing to do, was to move the "moodledata" folder into one of the folders that "php.ini" is allowed to access via the "open_basedir" variable.

--> move "moodledata" next to your "moodle30" folder
---> change "CFG->dataroot" to ABSOLUTELY point to your moodledata folder.
e.g.: in my case :
"$CFG->dataroot = '/home/vol15_5/byethost9.com/b9_20167838/education.byethost9.com/htdocs/moodledata';"


Granted, this is not the prettiest solution ... but at least it will get you moving along.

Hahaha, after all that, for some reason the CSS files are not loaded properly... whoops, can't win them all can ya?

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}