PHP is_writable() returns true but file_put_contents() returns false
<p>I'm having trouble writing to a file even though <code>is_writable()</code> returns true. Of course, the file exists and is apparently readable. Here is the code:</p>

<pre><code>$file = "data";
echo file_get_contents($file)."&lt;br&gt;";
echo is_writable($file) ? "is writable&lt;br&gt;" : "not writable&lt;br&gt;";
if (file_put_contents($file, "ghijkl", FILE_APPEND) === FALSE) echo "failed&lt;br&gt;";
echo file_get_contents($file)."&lt;br&gt;";
</code></pre>

<p>And here is the output:</p>

<pre><code>abcdef
is writable
failed
abcdef
</code></pre>
