Fatal error: $CFG->dataroot is not writable
Today I ran into the same error.
After a while i got the idea.
On any linux box such as Red Hat, Cent OS, fedora and Co there is a pretty good likelihood that SELinux is enabled and enforced.
First of all you should check the directory and file permissions. Being at least accessible and readable to the web server - most often apache. Dirs and files should be owned by apache:apache.
The SELinux is quite consequent. I therefore ran into this issue after relabelling the system.
In case that after permission setting the web server still does complain about
„$CFG->dataroot not writable“
look at the SELinux labels of the dirs and files in $CFG->dataroot.
They are displayed with the CLI
ls -lZ /full_path_of_dataroot
All labels should be
apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 1. Dez 14:21 cache
The httpd_sys_rw_content shows that the dir or file is writeable.
In case this is not given execute
sudo chcon -R -t httpd_sys_rw_content_t /full_path_of_dataroot
This will change the file context recursively to the type httpd read/write.
Reload the webpage.
Showing posts with label moodle. Show all posts
Showing posts with label moodle. Show all posts
Sunday, January 17, 2021
Thursday, April 25, 2019
Solution to Moodle Error: Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write.
Did you ever come across the following error when you try to access Moodle,
"Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write."
This usually happens when cache files are corrupted, one probable cause can be improper shutdown of Moodle system.
Here is the solution to fix the issue.
1. Go to Moodle root directory
#cd /var/www/html/moodle
2. Run the command
#php admin/cli/purge_caches.php
5. Refresh the Moodle Page. Its should work
Source : https://sjamso.blogspot.com/2018/08/solution-to-moodle-error-coding-error.html
"Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write."
This usually happens when cache files are corrupted, one probable cause can be improper shutdown of Moodle system.
Here is the solution to fix the issue.
1. Go to Moodle root directory
#cd /var/www/html/moodle
2. Run the command
#php admin/cli/purge_caches.php
3. Go to moodledata/cache directory
#cd /var/moodledata/cache
4. Remove the cache store directory, DO NOT remove of change the core_component.php file
# rm -rf cachestore_file/
5. Refresh the Moodle Page. Its should work
Source : https://sjamso.blogspot.com/2018/08/solution-to-moodle-error-coding-error.html
Monday, October 22, 2018
Tuesday, October 25, 2016
ganti ip ke domain moodle
Edit DNS domain dari ip adress ke moodle ada peringatan
"Incorrect access detected, this server may be accessed only through "http://124.40.255.XXX/moodle" address, sorry.
Solusi
ganti wwwroot nya di config.php
"Incorrect access detected, this server may be accessed only through "http://124.40.255.XXX/moodle" address, sorry.
Please notify server administrator.
This page should automatically redirect. If nothing is happening please use the continue link below.
Continue"Solusi
ganti wwwroot nya di config.php
dengan $CFG->wwwroot = 'http://' . $_SERVER['HTTP_HOST'];
Link : http://stackoverflow.com/questions/25879299/moodle-apache-proxy