![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
jays_rhino
-
Posts
2 -
Joined
-
Last visited
Never
Posts posted by jays_rhino
-
-
Hello, I am having trouble with a ridiculously easy script, and I am hoping you can help. Here is the code I am having trouble with.
if(!file_exists("Batch/TheReport.txt")) { $Error = 1; $ErrorReason = "There is no file<br>"; } if(!$file = fopen("Batch/TheReport.txt", "w")) { $Error = 1; $ErrorReason .= "Can't Open The File<br>"; }
When I ran this on my local windows server it worked just fine, but when I uploaded it to our linux server, it passes the first test of recognizing the file is there, but it can't open it. I have made sure that the permissions are set properly so that I am able to write to the file but still no luck. Do any of you know what I might need to look at that would cause this to work diferrently from a windows server to a linux server? Thanks in advance.
[SOLVED] fopen Frustration
in PHP Coding Help
Posted
ok, I had set the permissions on the directory, but just assumed those permissions carried on down to what was in there. I changed the permission on the file itself and works fine now. Thanks again for the help on such a simple thing.