Can't write to file on localhost
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    40

    Can't write to file on localhost

    Morning, Having problems with write to file on localhost.

    Just wanted to run a simple test using php file put contents or even fwrite and it's not working.

    Even made the folder and it's contents 777 for testing and ensured I am the owner of the folder and contents

    Any ideas please?

  2. #2
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    40

    Re: Can't write to file on localhost

    It's definitely SELinux, I'm a total novis at this and disable it to check and access to write to file works. I then put the setting back to 'enforce'.

    Now what?

    Thanks

  3. #3
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    40

    Re: Can't write to file on localhost

    It's definitely SELinux, I'm a total novice at this and disabled it to check and access to write to file works. I then put the setting back to 'enforce'.

    Now what?

    Thanks

  4. #4
    Join Date
    Dec 2012
    Location
    santa barbara, CA
    Posts
    911

    Re: Can't write to file on localhost

    edit /etc/selinux/config
    SELINUX=disabled
    SELINUXTYPE=disabled

    reboot
    the edit /etc/default/grub
    GRUB_CMDLINE_LINUX="rhgb quiet selinux=0"
    grub2-mkconfig -o /boot/grub2/grub.cfg

    reboot.
    no more problems.

    selinux was created for the US military to have "secure and separate user spaces", like in the old mainframes.
    we don't need that in a home computer, besides nobody knows if the NSA is spying through it.
    "monsters John ... monsters from the ID..."
    "ma vule teva maar gul nol naya"

  5. #5
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    40

    Re: Can't write to file on localhost

    Quote Originally Posted by bobx001
    edit /etc/selinux/config
    SELINUX=disabled
    SELINUXTYPE=disabled

    reboot
    the edit /etc/default/grub
    GRUB_CMDLINE_LINUX="rhgb quiet selinux=0"
    grub2-mkconfig -o /boot/grub2/grub.cfg

    reboot.
    no more problems.

    selinux was created for the US military to have "secure and separate user spaces", like in the old mainframes.
    we don't need that in a home computer, besides nobody knows if the NSA is spying through it.
    Cheers Bobx01

    I ended up installing trouble shooter and it then provided some help and bash commands to allow access.

    I have thought the same about selinux and it's necessity on a home computer but as it's working (for now) I'll leave it as is

    Cheers for the reply

    Much appreciated

  6. #6
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,225

    Re: Can't write to file on localhost

    If the top level file has a constraint, then the directory under that top level dir also has a constraint.

    I have a /scratch (its in root and it is owned by root)
    For my /scratch/Development, I had to sudo chmod 1777 /scratch The 1777 makes the /scratch rwx for anyone, with no rwx restriction.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840