title: unable to write to file with PHP cURL with curlopt_stderr and curlopt_file
body: <p>I'm trying to log the information from a cURL hit into a log file but am unable to do so,
  I run windows with wamp and have given full control to all users in the machine and the log and php file that invokes cURL are in same directory for this test. I've used the below code:</p>
  
  <pre><code>$session = curl_init();
  $logfh = fopen("my_log.log", 'a+');
  if ($logfh) {
    print "Opened the log file without errors";
  }
  curl_setopt($session, CURLOPT_HEADER, false);
  curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
  // Optional settings for debugging
  curl_setopt($session, CURLOPT_VERBOSE, true);
  curl_setopt($session, CURLOPT_FILE, $logfh); // logs curl messages
  // curl_setopt($session, CURLOPT_STDERR, $logfh); // logs curl messages
  curl_exec($session);
  curl_close($session);
  </code></pre>
  
  <p>The log file opens without error and my cURL returns success but nothing is logged into the file.I've used <code>CURLOPT_FILE</code> and <code>CURLOPT_STDERR</code> alternatively but neither help the cause and not sure if i got something wrong here. Any suggestions on debugging this would be appreciated.</p>