FedoraForum.org - Fedora Support Forums and Community
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    39

    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
    39

    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
    39

    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
    786

    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
    39

    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,107

    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

  7. #7
    Join Date
    Feb 2009
    Location
    Florida
    Posts
    632

    Re: Can't write to file on localhost

    When debugging selinux issues it is sometimes useful to switch from "enforcing" to "permissive" status.
    This will throw a warning message about the detected issue, but will not block the activity. Usually gives you enough info to correct the issue and then return to "enforcing" security levels.

    I do not support the idea that personal security is less important than business/government security. ( if NSA wants to look at you they don't need any help from selinux )

    You might find this helpful:
    https://wiki.gentoo.org/wiki/SELinux...rsus_enforcing
    Laptop: Toshiba / Intel B960 2.20Ghz x2/ 4GB/ 320GB SataII/ Intel HD/ fc28.x86_64
    Tower: GigaByte (970A) / AMD FX 8320 3.5Ghz x8/ 16GB/ 9TB Sata III/ AMD 6770HD/ fc28.x86_64
    Bookshelf: Shuttle DS61 (H61)/ i3-3225 3.3Ghz x2/ 16GB/ 320GB Sata II/ Intel HD 4000/ fc27.x86_64
    Embedded: BeagleBone Blk / ARM AM3358 1 GHz x1/ 512MB/ 2GB eMMC/ PowerVR SGX530/ fc27.armv7hl

Similar Threads

  1. Replies: 2
    Last Post: 15th March 2011, 10:00 PM
  2. Replies: 0
    Last Post: 4th June 2010, 09:30 PM
  3. Cannot write a file
    By northwestdev in forum Using Fedora
    Replies: 1
    Last Post: 24th July 2009, 09:03 PM
  4. how i can write file on Usbflash fat file system?
    By sharin00 in forum Hardware & Laptops
    Replies: 6
    Last Post: 21st February 2009, 10:17 PM
  5. GDM could not write to your authorization file?
    By carlos in forum Using Fedora
    Replies: 2
    Last Post: 16th December 2004, 10:26 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •