I have this code, but it says it is not able to open it:

$myFile = "/home/user/Desktop/webapp.log";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "Stuff";
fwrite($fh, $stringData);
fclose($fh);