Moodle 2.02 Dataroot location is not secure error Opensuse 11.4(64bit)

Hi everyone,

I have opensuse 11.4 in which I am trying to install Moodle 2.02 on my server. In the install.php it asks for where you want to place your moodle and moodledata directories, which in the default installation of Moodle in Opensuse is /srv/www/moodle and /srv/www/moodledata. It initially automatically fills in /srv/moodledata for the moodledata directory. When I change it to the default opensuse location it balks at the /srv/www/moodledata with “Dataroot location is not secure”. It won’t let me get past it. I have Moodle 1.99 running on opensuse 11.1 with those same directories. What can I do to get around this error message? Thanks for any direction you folks can give me.


Simple, don’t put dataroot on any directory that could be accessed via the webserver. In your case I could access the files in dataroot by going to, bypassing Moodle. This is a security hole and Moodle has obviously got stricter about this.

Put it in for example, /srv/moodledata, or /var/lib/moodledata or somewhere that is not a webserver directory.

Thank you very much for your response, but if I do try to move it do /srv/moodledata, this is the error I get on the install.php of moodle:

Warning: file_exists(): open_basedir restriction in effect. File(/srv/moodledata) is not within the allowed path(s): (/srv/www/moodledata:/srv/www/moodle:/tmp:/etc/moodle) in /srv/www/moodle/install.php on line 312 Warning: is_writable(): open_basedir restriction in effect. File(/srv) is not within the allowed path(s): (/srv/www/moodledata:/srv/www/moodle:/tmp:/etc/moodle) in /srv/www/moodle/install.php on line 316

See here on how to add a directory to the open_basedir paths for Moodle to allow access there:

PHP: Description of core php.ini directives - Manual

Moodle must have specified those directories so it must get that info from somewhere.

Also did you edit the dataroot in Moodle’s config.php? Maybe you’re still using the old value there.

Incidentally you should also ask on the Moodle forums, as this is not an openSUSE specific question and the people at the Moodle forum will have lots of experience with this issue.

Thanks for your help. I found that the open_basedir restrictions were in the file: /etc/apache2/conf.d/moodle_include.conf

At least I got rid of that error, now on to the next ones :slight_smile: