我通过添加命令在 Ubuntu 上安装了网络驱动器(运行 Windows Server 2008)
//10.10.101.54/docflow /opt/lampp/htdocs/mount cifs user=administrator,password=wbaZaja43ik,rwx,user,auto,file_mode=6777,dir_mode=6777,uid=1000,gid=1000
在 /etc/fstab
中,但在该映射驱动器上的文件和目录上使用 PHP 函数 is_file()
或 is_dir()
时遇到问题。当对现有文件或目录调用时,这些函数都会返回 FALSE - 由 file_exists()
函数检查正确的路径,该函数可以正常工作。 PHP 在“管理员”用户下运行,并拥有操作所需的所有权限。
知道如何解决这个问题吗?
谢谢!
最佳答案
引自 gmail dot com 的 digitalaudiorock comments在 PHP 手册中:
Just a note for anyone who encounters is_dir() returning false on CIFS mount points or directories within those mount points on 2.6.31 and newer kernels: Apparently in new kernels they've started using the CIFS serverino option by default. With Windows shares this causes huge inode numbers and which apparently can cause is_dir() to return false. Adding the noserverino option to the CIFS mount will prevent this. This may only occur on 32 systems but I don't have a 64 bit install to test against.
关于php - 某些 PHP 函数无法在映射的网络驱动器上正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10440920/