a short intro 😉 :
for a file exist 3 different groups of people who could try to access it:
the owner of the file (u - user), all users of the same group (g) and
all others (o)
each of these groups can have different permissions for reading (4),
writing (2) and executing (1) of the file
add these numbers to combine permissions, ie read + exec = 4+1 = 5
the resulting number contains these single permissions in the order
ugo (see above)
ie 754 would allow the owner to do everything, group members
may read and execute and all others just read
in general there are 2 user involved on a webserver:
files you uploaded yourself are owned by the ftp-user with which
you login
the scripts etc are executed by the webserver (Apache), PHP is
exec'ed by Apache, too, so it's the same user
hence, all files created by Apache/PHP are owned by the Apache-User,
not the ftp-user
in short: you have to set the permissions of your uploaded files
so that Apache can access it correctly
example:
a php-script, uploaded via ftp:
705 should be enough, ftp-user can delete the file if wanted and
apache can read and execute the script
remember to give write access to log files and similar stuff, like
707
Hope that helps and is not too confusing 🙂
ps: another type of representing is the rwx-style
u g o
rwx r-x r--
would be 754