• Resolved Robert Eichhorn

    (@robert-eichhorn)


    I’ve read that directory permissions apply to all the files in the directory. If a file has its own set of permissions, those take precedence over the directory permissions. In the case of default settings for a directory (755) and files (644), there would be no way for a file to be executed. Here’s how the default settings are applied:

    1. Directory (755)
    a) User = read/write/execute (7)
    b) Group = read/execute (5)
    c) World = read/execute (5)

    2. Files (644)
    a) User = read/write (6)
    b) Group = read (4)
    c) World = read (4)

    Evidently, for these default settings to work the directory permissions have to take precedence over the file permissions. I notice that the difference between the directory permissions (755) and the file permissions (644) is the directory permissions include the execute permission and the file permissions do not include the execute permission. It seems to me that the directory permissions are being used to handle server requests and file permissions are being used for working on files. What’s the real story here?

    • This topic was modified 3 years, 3 months ago by Jan Dembowski.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You’re getting confused by what “execute” means in server terms. In server terms, .php files are never executed, they are merely read. The only files that execute are actual system files, for example in Windows systems, .exe files can be executed. .php files are still only read (for the PHP interpreter), never executed by the system.

    The concept of files inheriting folder permissions unless overridden applies to Windows file systems, not Linux. In Linux, AFAIK every file and folder has its own set of permissions, they don’t get inherited. The concept of executing a folder merely means it can do things with the files it contains beyond just reading them. Think of a folder as its own little executable app to manipulate (rename, delete, etc.) the files it contains.

    Thread Starter Robert Eichhorn

    (@robert-eichhorn)

    bcworkz – thanks for the help. Some new information for me to consider. I have become aware that there is a difference between permissions for directories and files. I definitely need some clarification on the subject of permissions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Questions about Directory and File Permissions’ is closed to new replies.