It is always giving the message as "not created". I have checked the permissions and its 777. What to do? It is running perfectly in command line mode.
this is the code:
<?php
$msg = "I'm a line that is a message.
";
$path = $_SERVER['DOCUMENT_ROOT'] . '/myawesome_logfile.txt';
echo $path;
chmod($path, 0777);
$f = fopen($path, "a+"); //opening or creating the file
if($f)
echo "file created";
else
echo "not created";
fwrite($f, $msg); //writing the file
fclose($f);
?>