$d = "../saves/".$id.".php";
$f = fopen($d, "w") or die("did not open");
fwrite($f, $editor) or die("did not write");
fclose($f);
So recently I migrated to AWS, which uses PHP7 as opposed to PHP5 which is what the old server ran. As a result, some of my previously working code is no longer working. In this instance, a query is fetched from a table in the database, then the id of the row is saved to $id. A unique page is then attempted to be created in the saves directory, which is parallel to the directory in which the above code lies. When the above is ran, "did not open" is returned and I cannot figure out why as it worked before.
Folder directory:
-home
--saves
--file with the above code
Try below trick, may will help you.