You need to give dataroot folder 777 permission where your all data is stored. Please give this permission with terminal so that all files and folders inside data folder are writeable
Thank you for the response. We've already set the permission of the moodledata folder to 777 long before we've encountered the problem. What we don't understand is that it displays the "Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting." error and the server is unresponsive/freezes so we have to restart the server. Could it be that the hardware (server) that is causing the "Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting." error since its unresponsive and Moodle cannot access the dataroot folder?
Thanks for complete description of system.
Question: the moodledata directory might be on a partition of it's own (/data). The 'df' command will show all partitions/devices.
If Moodle is set to use files for session information that attempts to write a session file to moodledata/sessions/. Can change that behavior by editing config.php and adding: $CFG->dbsessions=1;
That will use DB for session information.
Typically, DB files are on/in /var/
Is apache server still running? ps aux |grep httpd
Check logs: `dmesg | less`
Might check CentOS forums for such situations where system mounts a partition as ro.
'spirit of sharing', Ken
Indeed, it's a SELinux issue. I had met the same problem..
If you don't want to disable SELinux at all, you can run the following command:
chcon -R -t httpd_sys_content_t /path_to/moodledata
This sets SELinux to allow apache to write to the directory.