Page 1 of 1

CHMOD help

Posted: Mon Nov 26, 2007 3:55 am
by iceangel89
i am new to chmod and would like to know what are value like 644/755/777 etc are. i searched google and most gave me info on linux ones like -wx etc. how do i convert whose to numeric ones PHP uses?

Posted: Mon Nov 26, 2007 4:07 am
by CoderGoblin
php manual wrote:The mode parameter consists of three octal number components specifying access restrictions for the owner, the user group in which the owner is in, and to everybody else in this order. One component can be computed by adding up the needed permissions for that target user base. Number 1 means that you grant execute rights, number 2 means that you make the file writeable, number 4 means that you make the file readable. Add up these numbers to specify needed rights. You can also read more about modes on Unix systems with 'man 1 chmod' and 'man 2 chmod'
from chmod()

Posted: Mon Nov 26, 2007 4:23 am
by iceangel89
thanks just read that. so the first number - Last is User Group Everyone? so when i login as admin thats a user? so when installing something like Joomla, 700 will be enough? but i set 777 anyway cos 755 didn't wont either or is it 750 not too sure... but anyway, logged in users will be under? they cant have any 7s right?

but anyway, whats the common value to use? i read is 644/750?

Posted: Mon Nov 26, 2007 7:57 am
by CoderGoblin
When using 3 digits the first is the file owner, second is the user group in which the owner is in, and third (last) is to everybody else (call it rest of the world if they get into the system). A lot depends on how your users and groups are set up and who needs specific access to the files. In linux you can always change what user and group the file "belongs" to via the chmod and chgrp commands. You may want to use your favourite search engine to get a detailed explanation. Unfortunately I do not have any links immediately to hand.