Fatal error: $CFG->dataroot is not configured properly (but moodle 3.2.1 works)

Fatal error: $CFG->dataroot is not configured properly (but moodle 3.2.1 works)

by Daniel Sterchi -
Number of replies: 1

Hi there

I installed moodle many year ago. I had no problems to install and upgrade, and upgrade, and upgrade,…

I upgraded my moodle from 3.1 to moodle 3.2.1 just yesterday at the end of the semester. Everything works fine as always.

But now, I want to solve a «to check» warning that started to show up a while ago. I want to convert my tables from InnoDB tables to Barracuda. So I start to follow the instructions.

  • I started a ssh connection to my server
  • I started the script: php /moodle/admin/cli/mysql_compressed_rows.php -i

Then there is this message: Fatal error: $CFG->dataroot is not configured properly…

What I did so far:

  • I checked that the data root is where it should be (configured in config.php)
  • I checked the permission
  • I scratched my head…

Is there any suggestion what the reason for such a behaviour might be. As I already mentioned that the data root is used by moodle (checkt the timestamps)


kind regards

Daniel (from Switzerland)

Average of ratings: -
In reply to Daniel Sterchi

Re: Fatal error: $CFG->dataroot is not configured properly (but moodle 3.2.1 works)

by Randy Thornton -
Picture of Documentation writers

What directory is your working directory when you start this?

The compress_row php file is expecting to locate the config.php file a couple of directories up the tree in '/../../config.php'

Try going into the cli directory first, then calling php from there...