move from localhost to hosting

19,997

For the wwwroot you should include http and remove the trailing slash

$CFG->wwwroot = 'http://subgominio.com/moodle-2.3.11';

For security, the data root needs to be outside of the www root.

For example, if your site is in

/home/subgominio/public_html/moodle-2.3.11

Then the data root should be in

/home/subgominio/moodle_data

You will also need to change the permissions of the folder to 02777 so it is writeable.

Then change the config to

$CFG->dataroot = '/home/subgominio/moodle_data';
Share:
19,997
Admin
Author by

Admin

Updated on June 15, 2022

Comments

  • Admin
    Admin almost 2 years

    When I try enter my moodle from internet I see this message:

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

    I don't know how I can fix it. What did I do?

    1. I entered my filizilla.
    2. My domain folder is empty so I put my moodle_data folder and moodle-2.3.11 folder (I tried to put moodle_data folder in the root where I see all my folders)
    3. I created a data base in my hosting.
    4. I updated my config.php but I'm not sure what I have to put in this lines:
    $CFG->wwwroot   = 'localhost/moodle-2.3.11';// I should put subgominio.com/moodle-2.3.11/
    
    $CFG->dataroot  = 'C:\\xampp\\moodledata';// I don't have idea what I have to put here, because I put in the root.
    
    $CFG->admin     = 'admin'; // I don't have any idea which information put here
    
    1. When I opened this link bookstore.mainstreetschoolhouseinc.com I see my files and after I open the folder moodle-2.3.11 and I see this message:

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