SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,599
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    Need to set file permissions

    Hello, just got a new website up and running. I use several PHP includes to make sitewide changes easy.

    For example I have a settings.php file that just contains my doctype and my <head></head> stuff. I don't want this visible for someone to just go to my site and do ryanreese.us/settings.php (not that people *should* know it exists)..but still.

    What permissions would I have to set for this to happen?

    I was unable to think of the correct keywords in a google search.
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    I would say just bury it a few folders deep that no one will ever fine. All the same, does it really matter if anyone sees the file? They can see the results in the HTML anyhow.

  3. #3
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,599
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Burying it a few folders deep only hides the problem. I'd really just prefer to set the file permissions. Knowing that people *could* get to it nags at me.
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Its not file permissions you want. You have to move it outside of the web root.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  5. #5
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,599
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Would I still be able to access the files for PHP includes? Where else do I put those files if not in the web root?
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  6. #6
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Yes you would be able to. I don't know how you are setup, but usually "public_html" is the web root, anything above that would be the best.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  7. #7
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,599
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Yes there is one level above that .
    (/home3/ryanree1)

    Does that sound right? Anyway once I move files over there will I need to change the URLs of my includes to match?

    I'm about to go to bed now so I will try it in the morning to either confirm or deny the changing of URLs being needed.

    Thanks logic_earth.
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  8. #8
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    You will have to change the path...You should not be using URL (http) in PHP includes.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  9. #9
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,599
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I'm not using the URL in PHP includes, I'm just doing

    /settings.php

    That kind of thing. To target the base directory. How do I go even further up then?
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  10. #10
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    "../" goes up one directory.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  11. #11
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,599
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Everything sorted now. Decided to just go in there and do it now. Took all of 5 minutes.

    Thanks again, didn't know about that trick to hide files. I learned something today !
    Always looking for web design/development work. Willing to do it cheap to build portfolio!


Bookmarks

Posting Permissions

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