2011-02-04 178 views
1

这是我的设置。我有一个运行Apache和PHP的Linux机器。我在我的Linux机器上安装了一个文件夹,指向我的Windows服务器上存储我的HTML文件的目录。我的虚拟主机文件指向已安装的文件夹,因此Apache正在从Windows共享中获取文件。Windows共享上的PHP权限问题

我在打开一些问题。当我运行此:

<?php 

    echo 'cwd is: ', getcwd(), "<br />\n"; 
    echo 'target should be: ', getcwd(), "/data.txt <br />\n"; 
    echo 'file already exists: ', file_exists('data.txt') ? 'yes':'no', "<br />\n"; 

    $file = fopen("data.txt", "a"); 
    if (!$file) { 
     die('fopen failed'); 
    } 
    $c = fwrite($file, "\n$name,$lastname,$email"); 
    fclose($file); 
    echo $c, ' bytes written'; 
?> 

我得到以下回:

CWD是:/首页/布莱恩/网站/ Google日历/ HTML
的目标应该是:/家庭/布莱恩/网站/ googlecalendar/html/data.txt
文件已存在:否
警告:fopen(data.txt):无法打开流:第7行中的/home/brian/website/googlecalendar/html/testfopen.php中的权限被拒绝fopen失败

在Windows上,我已经检查了“html”文件夹的权限,并且所有设置都允许每个人都写。我不知道还有什么我需要改变。它应该工作,对吧?

回答

0

尝试,更改子目录和文件是该组中“WWW”

+0

假设他的apache用户为“WWW” – 2011-02-04 17:19:52