Jump to content

[SOLVED] fopen Frustration


jays_rhino

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.