dotkpay Posted September 25, 2011 Share Posted September 25, 2011 Hello, Am new to the concept of file permissions and am just trying to grasp the whole thing. But for starters, after I upload my php application to the web what file permissions should I set for individual files and for directories? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/247818-file-permissions/ Share on other sites More sharing options...
trq Posted September 25, 2011 Share Posted September 25, 2011 In general, files will only need to be readable by the web server. You might also need to grant write permissions to certain file and directories though depending on your needs. Quote Link to comment https://forums.phpfreaks.com/topic/247818-file-permissions/#findComment-1272546 Share on other sites More sharing options...
dotkpay Posted September 25, 2011 Author Share Posted September 25, 2011 Could you please give me the exact chmod figure for example 664 or 775 for the permissions you just described. Quote Link to comment https://forums.phpfreaks.com/topic/247818-file-permissions/#findComment-1272555 Share on other sites More sharing options...
trq Posted September 25, 2011 Share Posted September 25, 2011 It really depends on who owns the file and what group they are in. 644 will make a file read/write buy the owner, and readable to everyone else. 755 will make a directory the same. Quote Link to comment https://forums.phpfreaks.com/topic/247818-file-permissions/#findComment-1272557 Share on other sites More sharing options...
j.smith1981 Posted October 12, 2011 Share Posted October 12, 2011 Sorry not to walk all over thorpe with this one, has helped me out allot in the past. If you are running Linux (I can't remember for windows on this), but if Apache for example (presuming most people will be using Apache, I think IIS runs as System user), you would need to allow Apache to be able to write to those files or directories for them to work (not sure about commandline based apps though I think I can remember that being just your own user name), likewise with windows it would have to be System user you would need to allow to be able to write to that folder but I am not entirely sure. I don't think with Windows though Administrators enough but I have never really tried myself. Quote Link to comment https://forums.phpfreaks.com/topic/247818-file-permissions/#findComment-1278608 Share on other sites More sharing options...
thehippy Posted October 12, 2011 Share Posted October 12, 2011 Unix based OSs use the Owner-Group-Other file permissions system. Your example of 644 is a three digit code in octal (0-7) to represent the permissions on a file. The first digit '6' is the owners permission on the file, the second digit '4' is the group permission on the file and the third '4' is everyone else's permission on the file. The permission is an octal number representing the sum permission, the read permission is represented in the number by the value of 4, the write permission has the value of 2, the execute permission has a value of 1 and no permission has the value of 0. Again in your example (644) the owner has permission value of 6, from this we can derive that the permissions are the read permission (with the value of 4) and the write permission (with the value of 2). That's the basic stuff, there is more of course, this is the best tutorial I could find for you. Quote Link to comment https://forums.phpfreaks.com/topic/247818-file-permissions/#findComment-1278669 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.