I am working on a web application that uses PHP to manage user uploads. These uploads are located on external media that is mounted via NFS and symlinked into the Apache root directory. That is, let /mnt/uploads
be the mount point for the NFS uploads
share, and /var/www/http/public/uploads
is a symlink to /mnt/uploads
.
I want to use the PHP is_dir
command to verify the existence of this directory and its subfolders during a caching operation. However, is_dir
returns false
when passed either a relative or an absolute path to the symlink, even though the command should follow symlinks according to the PHP docs.
I have tried passing the absolute path /mnt/uploads
to is_dir
directly with no success; it still returns false
. This leads me to believe that the problem is related to the fact that the directory is an NFS mount and not that I am accessing it via a symlink. I have also tried clearing the stat cache, but I get the same results.
This server runs Ubuntu 14.04 LTS and is up-to-date.
/etc/fstab entry
$ cat /etc/fstab
my.nfs.server:/uploads /mnt/uploads nfs sec=krb5p,rw 0 0
Directory permissions
$ ll /mnt
drwxrwxr-x 6 someuser somegroup 4.0K Mar 1 08:48 uploads