UPDATE: I just realized how to fix this problem because the issue came up again with a new file. Sorry geXXos I misunderstood what you were trying to say.
I put this:
chmod($myFile, 0777);
In the .php file and it worked. Once again sorry for skimming over your advice geXXos. This is a working solution to this problem for future people.