如何检查保险丝文件夹是否存在
问题描述:
我在服务器上安装了一个指向sftp站点的文件夹. 我需要通过php检查我们是否可以看到其中的文件夹.
I have a folder mounted on the server that points to an sftp site. I need to check via php whether we can see the folders inside it.
我尝试过
file_exists("/path/to/the/mount/folder");
但是它返回的是false(这是我所期望的),我可以通过文件系统并使用终端来导航到它.
but its returning false (which I kind of expected), I can navigate to it through the file system and using terminal.
(也尝试过is_dir
&& is_link
)
(also tried is_dir
&& is_link
)
这是我从外壳上安装它的方式
Here's how I mounted it from the shell
echo PASS | sshfs UNAME@URL: /path/goes/here -o password_stdin
答
原来是配置问题.
在/etc/fuse.conf
中,我未评论user_allow_other
然后使用此命令挂载
echo PASS | sshfs UNAME@URL: /path/goes/here -o password_stdin,allow_other
正常的文件/文件夹检查/读取功能将正常工作
Normal file/folder checking/reading functions will then work fine