Moodle 錯誤訊息:Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! ...

安裝環境:

  • CentOS Linux release 7.4.1708
  • Apache 2.4.6
  • PHP 7.2.4

安裝好有幾天了,之前沒什麼問題,不過也沒什麼人用,今天突然有人反映進不去,網站一打開就只顯示一行錯訊:

Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting.

檢查了權限沒有問題

drwxr-xr-x. 12 apache apache  162 May 11 09:40 moodledata

就判斷是SELinux的問題,簡單的做法就是關掉SELinux

vi /etc/selinux/config

SELINUX=enforcing 改爲 SELINUX=permissive

存檔後,重新開機,就正常了。

你可能感兴趣的:(Moodle 錯誤訊息:Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! ...)