title: Cannot write create file using PHP file_put_contents
body: <p>I'm new at the whole php thing, and I need to write a file in the server (my own computer where I am developing a web app) with some config info. Here is the code I'm using:</p>
  
  <pre><code>  $filename = "config.conf";
    $db_info = $db_user . "&lt;-*-&gt;" . $db_passwd . "&lt;-*-&gt;" . $db_name;
    if (file_put_contents($filename,$db_info) === false){
        $ret["error"]  = "Can't create/write: $filename.";
        mysqli_close($con);
        echo json_encode($ret);
        return;   
    }
  </code></pre>
  
  <p>When I test my web app I get the create/write error I wrote. I checked and the file is not created. My working directory is in /var/www/tests however I've checked tests and my user has read and write permissions and is owner of that folder. If I create a file with a ordinary file explorer I have no problems whatsoever. Since the function is so simple, I am at a loss. Please help!</p>