title: nginx php-fpm failed to open stream permission denied
body: <p>I have a php file on my NGINIX(with php-fpm) that create a simple txt file.</p>
  
  <pre><code>&lt;?php
  $content = "some text here 123 myText.txt";
  $fp = fopen($_SERVER['DOCUMENT_ROOT'] . "/myText.txt","wb");
  fwrite($fp,$content);
  fclose($fp);
  ?&gt;
  </code></pre>
  
  <p>But this works only when I give my "www" folder 777 Permission. My Index.php is placed in my www folder.</p>
  
  <p>What is wrong with my user settings on nginix and php-fpm?</p>