【发布时间】:2010-12-29 15:01:07
【问题描述】:
我的路径和 fopen 参考我的 Web 服务器时遇到问题。
我有一个文件保存在 public/dan/new/apps/lovescopes/thisfile.php。
thisfile.php 将使用 fopen "x+" 在 public/internalServer/lovescopes/xml/2009/12 中创建一个新文件。
现在我的错误显示在 fopen 所在的行中:
如果我输入路径为相对路径,如
../../../../internalServer/lovescopes/xml/2009/12,我最终会出现 Permission Denied 错误。如果我输入像
/public/internalServer/lovescopes/xml/2009/12这样的绝对路径,我最终会得到“无法打开流:没有这样的文件或目录”
我仍然对应该使用相对路径还是绝对路径感到困惑。我有一个 ftp_nlist,它与#2 配合得很好。 Fopen是一样的吗?
还有我认为指向同一路径的不同错误消息,我不知道我做对了 1 还是 2?
【问题讨论】:
标签: php fopen relative-path absolute-path