sayan
sayan

Reputation: 66

Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting

unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype    = 'sqlsrv';
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'my remote db ip address';
$CFG->dbname    = 'remote database name';
$CFG->dbuser    = '****';
$CFG->dbpass    = '**********';
$CFG->prefix    = 'mdl_';
$CFG->dboptions = array (
    'dbpersist' => 0,
    'dbport' => 1433,
    'dbsocket' => '',
);
$CFG->wwwroot   = 'http://localhost/LMS';
$CFG->dataroot  = 'C:\\inetpub\\LMSdata';
$CFG->admin     = 'admin';
$CFG->directorypermissions = 0777;

This is my configuration in config.php. I'm using moodle 3.2 in IIS with php 7. Remote SQL server version 2012.

Upvotes: 2

Views: 21552

Answers (4)

AminFarajzadeh
AminFarajzadeh

Reputation: 408

Make sure 'inetpub' directory exists

Upvotes: -2

Huynh Cong Tru
Huynh Cong Tru

Reputation: 89

If you use IIS 10, you can do like this. enter image description here

The simple solution is to this problem is to change the NTFS permissions on the moodledata folder to allow write/modify to any user who is using moodle (I just set ours to domain users).

Upvotes: 1

Arslan Maqbool
Arslan Maqbool

Reputation: 529

How to allow your moodle data write permission.
Please follow these steps
For that please go to /var/www/moodledata or if any path where you defined the moodle data then just paste this command

sudo find . -type d -exec chmod 777 {} \;

I hope this will solve your permission problems

Upvotes: 0

gnuwings
gnuwings

Reputation: 950

The webserver does not have write permission to the folder ( C:\inetpub\LMSdata).Please modify the permission of the dataroot folder and allow write permission. This will solve the issue.

Upvotes: 1

Related Questions