ZhChT 討論區
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

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

    Scheduled Pinned Locked Moved 程式及系統
    1 Posts 1 Posters 119 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mfungM Offline
      mfung
      last edited by

      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 Reply Last reply Reply Quote 0
      • First post
        Last post