duanqiao1926 2016-06-13 15:22
浏览 99

NFS安装目录上的PHP is_dir失败

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
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号