title: chmod is not working on php and I can not write a file!
body: <p>Hi I want to write in a file with php, but I can not write anything. When I write this test function I got "Cannot change the mode of file deneme" error. How can use chmod and so that I can write into a file thanks for helping..</p>
  
  <pre><code>   &lt;?php
          function file_write($filename, $flag, &amp;$content) {
              if (file_exists($filename)) {
                  if (!is_writable($filename)) {
                      if (!chmod($filename, 0666)) {
                           echo "Cannot change the mode of file ($filename)";
                           exit;
                      };
                  }
              }
              if (!$fp = @fopen($filename, $flag)) {
                  echo "Cannot open file ($filename)";
                  exit;
              }
              if (fwrite($fp, $content) === FALSE) {
                  echo "Cannot write to file ($filename)";
                  exit;
              }
              if (!fclose($fp)) {
                  echo "Cannot close file ($filename)";
                  exit;
              }
          } 
  $a="osman";  file_write("deneme", "w", &amp;$a); 
  ?&gt;
  </code></pre>