title: PHP fopen() on local file that DOES exist
body: <p>Using php 5.2.17, on a Linux Server.  My office production machine is Windows7 Professional with Service Pack 1 installed.</p>
  
  <p>Trying desperately -- and so far, in vain -- to get <code>fopen()</code> to find and open a .csv file on my local machine in order to import records to an existing MySQL database on the server. Consistently getting a "failed to open stream" error message.</p>
  
  <p>Here is part of the code, with explanatory notes / server responses, including notes on what I have tried:</p>
  
  <pre><code>ini_set('track_errors', 1);   // Set just to make sure I was seeing all of the rrror codes
  ini_set ('user_agent', $_SERVER['HTTP_USER_AGENT']); // Tried after reading a note; no effect
  
  error_reporting(E_ALL);            // Again, just to make sure all error codes visible!
  echo(get_include_path()."&lt;br /&gt;"); // Initially returns: .:/usr/local/php5/lib/php
  set_include_path("C:\SWSRE\\");    // Have tried with BOTH forward and backslashes, BOTH single and doubled, in every conceivable combination!
  ini_set('safe_mode_include_dir',"C:\SWSRE");  // Ditto here for slashes!
  echo(get_include_path()."&lt;br /&gt;");  //NOW echoes "C:\SWSRE\"
  clearstatcache();  // Just in case this was a problem -- added after reading note @ php.net
  
  $file = "Individuals.txt";   // This absolutely DOES exist locally in C:\SWSRE\ (29Mb)
  // Inserted following tests to see if it even SEES the file.  It does NOT.
  if (file_exists("Individuals.txt")) {
      echo("File EXISTS!!!&lt;br /&gt;");
  } else {
      echo("File does NOT exist!&lt;br /&gt;");  // Echoes "File does NOT exist!"
  }
  if(is_readable($file)) {
      echo 'readable' ;
  } else { 
      echo 'NOT readable!&lt;br /&gt;';  // Echoes "NOT readable!"
  
  }
  if(is_writable($file)) {
      echo 'writable ' ;
  } else { 
      echo 'NOT writable!&lt;br /&gt;';  // Echoes "NOT readable!"
  }
  
  $handle = fopen("Individuals.txt", "r+", TRUE);
  </code></pre>
  
  <p>Here are the final PHP error messages:</p>
  
  <blockquote>
    <p>Warning: fopen(Individuals.txt) [function.fopen]: failed to open stream: No such file or directory in /home/content/b/u/r/burtsweeto/html/ADREImport.php on line 145
    array(4) { ["type"]=> int(2) ["message"]=> string(118) "fopen(Individuals.txt) [function.fopen]: failed to open stream: No such file or directory" ["file"]=> string(56) "/home/content/b/u/r/burtsweeto/html/ADREImport.php" ["line"]=> int(145) } </p>
  </blockquote>
  
  <p>Finally, I have tried putting the file up in the directory where the PHP script is running; and it does work exactly correctly there!  I'm just trying to minimize ongoing headaches for the end-user by not having to upload a huge file before doing the import.</p>
  
  <p>Any suggestions that I have not tried?</p>