fopen()函数需要搜寻文件,
resource fopen ( string filename, string mode [, int use_include_path [, resource zcontext]] )例子:
<?php
$handle = fopen ("/home/rasmus/file.txt", "r");
$handle = fopen ("/home/rasmus/file.gif", "wb");
$handle = fopen ("http://www.example.com/", "r");
$handle = fopen ("ftp://user:[email protected]/somefile.txt", "w");
?>

解决方案 »

  1.   

    没有道理的!
    对比下面代码的结果,并检查是否有写入权<?php
    echo getcwd();class zz{
    function __destruct(){
    echo '<br>'.getcwd();
    }
    }
    $zz = new zz; 
    ?>
      

  2.   

    contact at tcknetwork dot com
    21-Sep-2005 12:54 
    be careful while trying to access files with __destruct() because the base directory (getcwd()) will be the root of your server and not the path of your script, so add before all your path called in __destruct() :
    EITHER  dirname($_SERVER["SCRIPT_FILENAME"])."my/path/"
    OR      dirname(__FILE__)."my/path/"
             (be careful with includes, it will give the path of the file processed and not the main file)
      

  3.   

    Meteorlet(www.dictworld.com) 说的应该没错了.
    第一个程序把文件写到根目录去了.
      

  4.   

    C:\myweb\test
    C:\Program Files\Apache Group\Apache2