Page 1 of 1

Help with File Open

Posted: Sun Jan 25, 2009 8:45 am
by casey64
Could someone help me understand why this isn't work or how to isolate the issue?

Originally I wanted to open a file called stats.txt, but I couldn't get that to work so I thought I would try opening my myFunctions.php file because I am using it as an include in my main file and it is obviously working as an include, so I know the path and access should be correct since the include is working. I get 'unable to open file in each case'. My include code is:

include("./myFunctions.php");

My file open code is:

$fh = fopen("./myFunctions.php", "r");
if($fh==false)
{ echo("Unable to open file"); }

I've also tried

$fh = fopen("myFunctions.php", "r");
if($fh==false)
{ echo("Unable to open file"); }

$fh = fopen("/myFunctions.php", "r");
if($fh==false)
{ echo("Unable to open file"); }

$fh = fopen('./myFunctions.php', 'r');
if($fh==false)
{ echo("Unable to open file"); }

Thanks!

Re: Help with File Open

Posted: Sun Jan 25, 2009 7:06 pm
by casey64
Nevermind, guess I will use the other forum, have been getting help there throughout the day and have got nothing here.

Re: Help with File Open

Posted: Sun Jan 25, 2009 10:59 pm
by Benjamin
Turn on error reporting.

Re: Help with File Open

Posted: Mon Jan 26, 2009 2:14 am
by Motanelu
Also keep in mind that Linux/Unix filesystems are case sensitive...