Unix File Permissions are quite strict. You probably should get a Unix/Linux Book a good one being Running Linux which I am reading will help quite a bit with PHP and any language that you wish to use on a Unix Based Operating System.
Ok heres something
running the ls -l command gives something like this
rwxrwxrwx - filename.php
That in octal format is 0777
rwx stands for
r = Read
w = Write
x = Execute
we have 3 groups
user
group
other
so at the moment we have given
user - Read Write Execute Permissions
group - Read Write Execute Permissions
other - Read Write Execute Permissions
//just split them to show you
[rwx] [rwx] [rwx] - filename.php
No other is basically anything else PHP normally when running as a language for the web, runs as nobody same with Apache.
Now since nobody isnt the User that owns the file nor in the same group of the User that owns the file it comes under other.
so a 644 permission gives us
[rw-][r--][r--] - filename.php
I grouped them again to show you so
User has - Read and Write Permissions
Group has - Read only Permissions
Other has - Only Read permissions also
So we cannot write to the file. unless we run the php script under the user like a Perl Script on the command line. However since PHP is running as nobody it can only read the file.
If you want to see how to get an Octal.
User Permissions
Read = 400
Write = 200
Execute = 100
Group Permissions
Read = 40
Write = 20
Execute = 10
Other Permissions
Read = 4
Write = 2
Execute = 1
I hope this helps there is a little more into file permissions than i suggested and you should like i said get a book on Unx/Linux the one i suggested "Running Linux" I have now and reading, its a good read and will really help with anything you plan to do on a Unix based operating system