ZhChT 討論區
    • 版面
    • 最新
    • 標籤
    • 熱門
    • 使用者
    • 群組
    • 註冊
    • 登入

    Can not write to cache files, please check directory (discuzx)

    已排程 已置頂 已鎖定 已移動 程式及系統
    1 貼文 1 Posters 116 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • mfungM 離線
      mfung
      最後由 編輯

      Can not write to cache files, please check directory ./data/ and ./data/sysdata/ .
      相信在discuzx 好多人遇到這問題, 即使把data, 和 /data/sysdata/ 設成777也無法解決, 網上暫時無人提出解決方法

      原因是CentOS7的SeLinux, 會block了 php的 fopen指令, 令你完全cache唔到

      只要把SELinux關閉就可以, 只需一句command:

      sudo setenforce 0
      

      這便立即關了SELinux, 但是開機後又會再開, 因此你可以修改開機文件:

      /etc/selinux/config

      # This file controls the state of SELinux on the system.
      # SELINUX= can take one of these three values:
      #       enforcing - SELinux security policy is enforced.
      #       permissive - SELinux prints warnings instead of enforcing.
      #       disabled - No SELinux policy is loaded.
      SELINUX=disabled
      # SELINUXTYPE= can take one of these two values:
      #       targeted - Targeted processes are protected,
      #       mls - Multi Level Security protection.
      SELINUXTYPE=targeted
      

      SELINUX=disabled

      重新開機, 再check status

      sestatus
      

      SELinux status: disabled

      1 條回覆 最後回覆 回覆 引用 0
      • 第一個貼文
        最後的貼文