CFG error on website

Moodle is a bit tricky to work with. As said above by @Ziverre, the moodledata folder needs to be inside htdocs, so the last part of $CFG->dataroot needs to also be configured to /htdocs/moodledata instead of just /moodledata:

There’s a chance you may face an issue with the default session storage setting as well, in which case you also need to follow the steps here: