PHP fopen() fails on files even with wide-open permissions

前端 未结 3 1453
醉话见心
醉话见心 2021-01-02 09:29

I\'m currently migrating my LAMP from my Windows Server to a VPS running Debian 6. Most everything is working, however, one of the PHP scripts was failing to write to its c

3条回答
  •  生来不讨喜
    2021-01-02 10:24

    Could be a SELinux issue, even if Debian doesn't ship it in the default installation your provider could have enabled it. Look for messages in /var/log with

    grep -i selinux /var/log/{syslog,messages}
    

    If that's the cause and you need to disable it, here are instructions: look for file /etc/selinux/config, here it's default content. Change SELINUX directive to disabled and reboot the system.

    # 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 - SELinux is fully disabled.
    SELINUX=disabled
    # SELINUXTYPE= type of policy in use. Possible values are:
    #   targeted - Only targeted network daemons are protected.
    #   strict - Full SELinux protection.
    SELINUXTYPE=targeted
    

提交回复
热议问题