Installation help

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

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

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?

 
Average of ratings: -
Picture of Danny Wahl
Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting
Group DevelopersGroup Particularly helpful Moodlers
the double slash is to escape the slash for the database to store it.

you may need a trailing slash on the path:

moodledata\\
 
Average of ratings: -
Picture of Markus Strobl
Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting
 

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.

 
Average of ratings: -
Picture of Markus Strobl
Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting
 

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.

 
Average of ratings: -
Picture of Petr Skoda
Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
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
 
Average of ratings: -
Me
Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting
 
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.
 
Average of ratings: -
Me
Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting
 
I pushed the discussion forward to flash forum:

http://moodle.org/mod/forum/discuss.php?d=156096
 
Average of ratings: -
Picture of Syslian MS
Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting
 

I solved this error with this way

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

 
Average of ratings: -
Picture of Mario Eirea
Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting
 

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

 
Average of ratings: -
Picture of Ran Wi
Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting
 

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.

 
Average of ratings: -
Picture of Ronald Muzares
Re: v2 pv2: ERROR Fatal: $CFG->dataroot is not configured properly! Exiting
 

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

 
Average of ratings: -