v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Markus Strobl -
Število odgovorov: 16

We have changed out testing environment to a WIn2008R2 Server with the IIS 

Now we get the error-message:  Fatal: $CFG->dataroot is not configured properly! Exiting

Extract of our config.php:

$CFG->dataroot  = 'C:\\www\\edv\\Moodle2\\moodledata';

The "real" windows-path: C:\www\edv\Moodle2\moodledata

I tried single-backslahes in the dataroot-string - the result was the same. But the double-backslash was suggested from moodle itself creating the config.php

User "Everbody" has complete access to the path!

Whatelse can be the solution?

Povprečje ocenitev: -
V odgovor na Markus Strobl

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Danny Wahl -
the double slash is to escape the slash for the database to store it.

you may need a trailing slash on the path:

moodledata\\
V odgovor na Danny Wahl

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Markus Strobl -

Thx for your answer, but I tried all the possibilities with or without trailing slashes, double oder singleslash yet. Nothing seems to work.

Since Moodle itseld writes the path in the config.php WITHOUT the trailing slashes I don't think that they are absolutely essential.

V odgovor na Markus Strobl

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Markus Strobl -

I have now included the debug-code


@error_reporting(1023);  // NOT FOR PRODUCTION SERVERS!
$CFG->debug = 38911;
$CFG->debugdisplay = true;

in my config.php but I always get only one line back:

Fatal: $CFG->dataroot is not configured properly! Exiting.

V odgovor na Markus Strobl

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Petr Skoda -
Slika Core developers Slika Documentation writers Slika Particularly helpful Moodlers Slika Peer reviewers Slika Plugin developers
Hi,
the question is: does the directory exist, is it writeable for the web server?

Please try to use the latest cvs version or nightly package, the error messages there were improved a bit.

Petr
V odgovor na Petr Skoda

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Christian Peters -
Heyhey,

Is there a solution, yet?

I'm having the same problem (under same conditions) and it only occurs in functions and classes!

Thus:

<?php
include_once "pathtoconfig/config.php";

function test() {
global $CFG;
var_dump($CFG);
}

test();
?>

Works fine. But the error occurs with:

<?php
function test() {
include_once "pathtoconfig/config.php";

global $CFG;
var_dump($CFG);
}

test();
?>

Fatal error: $CFG->dataroot is not specified in config.php! Exiting.

I'm experimenting with the zend_amf for flash in moodle 2.0 and I'm not able to get access to globals in flash. I guess this problems are connected.
V odgovor na Markus Strobl

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Syslian MS -

I solved this error with this way

$CFG->wwwroot = 'http://localhost/moodle';
$CFG->dataroot = 'C:\\wamp\\moodledata';

V odgovor na Syslian MS

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Mario Eirea -

My testing shows the account running moodle needs to have atleast modify access all the way though the entire path.

V odgovor na Syslian MS

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Ran Wi -

I solved this error by providing the absolute path to the moodledata directory on the host server.

$CFG->dataroot  = '/customers/154343347/mywebsite/moodledata';

'mywebsite' directory contains moodle installation. and 'moodledata' is a sub directory within moodle installation. It is set with recursive permissions 755 for itself and all files and directories under it.

$CFG->directorypermissions = 0775;

In case you need to find the absolute path to a script or a directory on your server, use a simple php script using following syntax.

<?php
$dir = dirname(__FILE__);
echo "<p>Full path to this dir: " . $dir . "</p>";
?>


Put the new file anywhere in the web-accessible directory on your server,
then just access that file from your favourite web-browser – and you’ll have the absolute path shown to you.

V odgovor na Ran Wi

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Ronald Muzares -

Hi Everyone,

I am new to this kind of coding. I badly need help about dataroot

I have setup the site into a windows 2003 server. The site is doing good when I am loading it on the server it self but if will access the site in another PC with the same network some other content is not working. Specifically the problem is the dataroot. The directory loaded in the site is the directory of the PC who is accessing it and not the directory of the server.
I would really appreciate it if someone here will help. Thanks!


http://pastebin.com/iZNV842D

V odgovor na Syslian MS

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Ainul Rohman -

Hallo

I have the same problem:

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

I've made the changes, but the error is still appearing.


$ CFG-> dataroot = '/home/UserServer/moodledata';

I put in the file: /home/UserServer/public_html/tryout

Can someone help me?

V odgovor na Ainul Rohman

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Orban Ioan -

Its simple:

move moodledata in publichtml or htdocs, give al permisions 777 (htdocs and moodledata);

change path in config.php.

Worked for me.

V odgovor na Orban Ioan

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Just H -

... and leave your site insecure kul

V odgovor na Just H

Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting

od Orban Ioan -

If, you have a better solution ... Please share with us....kul