将 afp 安装为不同用户以进行 php 访问
我已经安装了一个 afp 目录 afp://ServerName/Foo/,使用“Finder->Go->Connect to Server”到 /Volumes/Foo,现在我尝试通过以下方式访问它:
opendir("/Volumes/Foo/dirname/");
但是,我 在终端中安装
Warning: opendir(/Volumes/Foo/dirname/) [function.opendir]: failed to open dir: Permission denied in...
给我: /Volumes/Foo 上的 afp_1VqvPY000e413wKcJE13gANY-7.2d000004 (afpfs、nodev、nosuid,由 daniel 安装)
所以我需要将文件夹安装为 _www,或者以某种方式允许 _www 使用我的安装。我怎样才能做到其中之一?我猜我想可能 su 到 _www 或其他东西,但我不知道如何使用终端。
I've mounted an afp directory, afp://ServerName/Foo/, with "Finder->Go->Connect to Server" to /Volumes/Foo, now I'm trying to access it with:
opendir("/Volumes/Foo/dirname/");
However, I get an
Warning: opendir(/Volumes/Foo/dirname/) [function.opendir]: failed to open dir: Permission denied in...
mount in terminal gives me:
afp_1VqvPY000e413wKcJE13gANY-7.2d000004 on /Volumes/Foo (afpfs, nodev, nosuid, mounted by daniel)
So I need to mount the folder as _www, or somehow allow _www to use my mount. How can I do either one of these? I'm guessing I want to possibly su to _www or something, but I don't know how to with terminal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应该能够在终端中将卷安装为 _www。
sudo -u _www mount_afp -I //user@host/share /path/to/mountpoint
。如果要在 URI 中指定密码,请省略
-I
。或者您可以在脚本中使用
system()
或exec()
来使用mount_afp
。如果它用于 Web 服务器,您可能需要考虑在启动时自动安装共享。
Should be able to mount the volume as _www in the terminal.
sudo -u _www mount_afp -I //user@host/share /path/to/mountpoint
.Omit
-I
if you want to specify the password in the URI.Either that or you could use
mount_afp
usingsystem()
orexec()
from within the script.If it is for a web server you will probably want to look into automatically mounting the share at startup.