>i was reading a php book and it says on UNIX machines i must change the
CHMOD 
>to 666 or 777, how do i do this? i never heard of the CHMOD. thanks.

Nobody wants in general to chomd a file 777!!!

Let me explain why:

chmod is an abbreviation of CHange MODe. The mode, or more specify the
access mode of the file is what is intended to be changed with chmod - so
don't change these flags unless you kmnow what you are doing!

Access right under unix is divided in three access groups. 1) Owner, 2)
Group and 3) Everybody. These groups has three flags for Read, Write and
Execute. These three flags could be set individually for each of the three
groups. 

There is two ways to manipulate the Access flags under an unix environment:

a) absolute and b) relative.

The absolute method uses number to manipulates the access rights. The access
right for each group are represented by three bits like this: 111

The first bit is the access right for Read, the second for Write, and the
third for execute. These three bits fits into an octal number (range 0-7),
and the chomd actually uses octal numbers. The first octal number is for the
owner access, the second for group, and the first, you got it, everybody.

So if all bits are set to one for an access group, that access group will
have Read, Write and eXecute right, in short RWX access.

The most significant bit is the left on, and hence its value becomes 4, the
second bit has the value 2 and the first bit 1. If we add the value of these
three bits together, we get the number 7. Seven hence means that we will
give RWX access to a file. This might be oki for the owner, and even for the
group, but do we wants to do this for everybody?

In most case the answer to this question is: NO

For the access right RX we have the bit pattern 101 (= 4 + 0 + 1 = 5), which
is the most common value to set for the access groups Group and Everybody -
if they need to be able to execute the file. If execute rights is not
needed, it is sufficient to give the access right R only ( 100 = 4 + 0 + 0 =
4), so if you need to read only a file, the proper chmod should be: 744 and
if execute is needed to: 755. Actually you don't need the R flag set under
unix to execute a file, so for execute 711 will be sufficient. Setting the
access right to 711, means that the user can execute the file, but not
display its contents.

However. Access rights are set for directories two, and then they are
interpreted a little bit different. Access right X for a directory means
that a user can do a CD into it. To be able to display the contents of a
directory both RX are needed for a directory, since you both need to be able
to access it and read it.

X access for a directory could be used as a
"pass-through-but-not-display-content-of" directory. Could be useful if you
don't want everybody to know how the tree structure really looks like.


For more information about chmod check the online page by typing '% man
chmod'

        /Anders


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to