SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Dec 2000
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello all~
    I used Kevin Yank's advice from his article (Building a Database Driven Web Site Using PHP & MySQL) about having your username and password in a separate file. However, I want to have the connect.inc file in the regular directory. The only problem is that I have to set permissions, which I don't a lot about. I know what they are. But what permissions do I use if I want the script to be able to read the file, but not everybody else?

    Any help would be appreciated.
    Corbb O'Connor
    Looking for quality website design or database programming?
    Contact me for more information and a FREE quote!

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    Monmouth Junction, NJ
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    your ftp program has something known as chmod and you should set this to 666 which means selecting the top 2 rows

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    Monmouth Junction, NJ
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why dont you just rename it to common.php if you dont want anyone to see it?

  4. #4
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I believe 666 would let anybody read the file.

    It depends what user the script is running as. If the script is running as the same user that created the file, then you can chmod it to 700, 770, 400 or 440

    Here's how to work out file permissions:

    You use an octal number, which is base 8. Each digit represents one of 8 combinations.

    There are 3 digits. The first are user permissions, the second group, the third are world (everyone) permissions.

    For each digit:
    Add 4 for read permissions
    Add 2 for write permissions
    Add 1 for execute permissions (perl, or other executed files).

    A 754 means:
    The user that created the file can read, write and execute it.
    The users in that user's group can read or write it.
    The world can only read it.

    My scripts run as user 'httpd' so I don't know how to restrict it as you wrote.

    But what you could do is move your inc file to a directory not viewable by the web - a directory that is above your 'web' directory. That's what I do.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff


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
  •