//testfile.php
<?php // testfile.php
$fh = fopen("testfile.txt", 'w') or die("Failed to create file");
$text = <<<_END
Line 1
Line 2
Line 3
_END;
fwrite($fh, $text) or die("Could not write to file");
fclose($fh);
echo "File 'testfile.txt' written successfully";
?>
//testfile.txt
tututu
If you receive an error message, your hard
disk may be full or, more likely, you may not have permission to create or write to the file, in which case you should modify the attributes of the destination folder accord‐
ing to your operating system. Otherwise, the file testfile.txt should now be residing in
the same folder in which you saved the testfile.php program.
Разрешение для папки у меня полное для всех, диск не полон, testfile.txt и testfile.php в одной папке