NYCPHP Meetup

NYPHP.org

[nycphp-talk] is_readable fails on 744 directory

Chris Snyder chsnyder at gmail.com
Mon Jun 8 14:17:51 EDT 2009


On Mon, Jun 8, 2009 at 2:08 PM, Néstor<rotsen at gmail.com> wrote:
> People,
>
> I have a directory /home/vlieu set to 754 permission and inside that
> directory I have a
> file with permission of 744.
> drwxr-xr--  4 vlieu  www   4096 Jun  8 10:19 /home/vlieu
> -rwxr--r-- 1 vlieu vlieu 1023 Jun  8 10:19 /home/vlieu/bid.csv
>
>
> When accessing the bid.csv file  using a php program the function
> is_readable()
> fails.  I guess because the apache server runs the php file as user
> 'nobody'.
>
> If I make the directory 755 (drwxr-xr-x) user nobody can read the bid.csv
> file but if I make
> the permissions 754 (drwxr-xr--) user nobody can not read the file.  WHY?
> In a 754 permission all users still have read permissions...what am I
> missing?
>
> Thanks,
>
> Nestor

Directory read only gives permission to see file names within the
directory, not to find out anything else about them (such as whether
they, themselves, are readable), or even to read them.
http://en.wikipedia.org/wiki/File_system_permissions#Basic_Permissions

The execute bit must be set on a directory in order to access files within it.


Chris Snyder
http://chxor.chxo.com/



More information about the talk mailing list