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

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

Markus Strobl發表於
Number of replies: 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?

評比平均分數: -
In reply to Markus Strobl

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

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\\
In reply to Danny Wahl

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

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.

In reply to Markus Strobl

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

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.

In reply to Markus Strobl

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

Petr Skoda發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 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
In reply to Petr Skoda

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

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.
In reply to Markus Strobl

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

Syslian MS發表於

I solved this error with this way

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

In reply to Syslian MS

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

Mario Eirea發表於

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

In reply to Syslian MS

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

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.

In reply to Ran Wi

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

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

In reply to Syslian MS

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

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?

In reply to Ainul Rohman

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

Emma Richardson發表於
Documentation writers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片

Have you checked permissions on the folder - is it accessible by the webserver user?

In reply to Ainul Rohman

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

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.

In reply to Orban Ioan

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

Just H發表於

... and leave your site insecure 酷

In reply to Just H

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

Orban Ioan發表於

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