php ファイルで、作成したテキスト ファイルにテキストを書き込みたいのですが、何も書き込まれません。
コードは次のとおりです。
<?php
    error_reporting(E_ALL);
    ini_set('display_errors', '1');
    if (isset($_POST['comment']))
    {
        $comment = $_POST['comment'];
        $myFile = "testFile.txt";
        $fh = fopen($myFile, 'w') or die("can't open file");
        $stringData = $comment;
        fwrite($fh, $stringData);
        fclose($fh);
    }
    else
    {
        $comment = 'no comment';
        $myFile = "testFile.txt";
        $fh = fopen($myFile, 'w') or die("can't open file");
        $stringData = $comment;
        fwrite($fh, $stringData);
        fclose($fh);
    }
?>