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!
Help with File Open
Moderator: General Moderators
Re: Help with File Open
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
Turn on error reporting.
Re: Help with File Open
Also keep in mind that Linux/Unix filesystems are case sensitive...