Page 1 of 1

Unable to read using file functions...[solved]

Posted: Tue Feb 07, 2006 5:42 pm
by raghavan20
I am unable to read a text file in the same directory. Look at this file at work

Code: Select all

<pre>
<?php

var_export(glob("*.*"));
var_export(file ("sampleDoc.txt"));
$fileString = file_get_contents("http://assorted.100webcustomers.com/sampleDoc.txt");
var_export($fileString);


?> 
</pre>

Posted: Tue Feb 07, 2006 5:45 pm
by feyd
permissions issue?

Posted: Tue Feb 07, 2006 5:55 pm
by raghavan20
This is the usual host which I have been using for a long time. I do not have a clue why it is not working? any guesses..

Posted: Tue Feb 07, 2006 6:01 pm
by feyd
As I said, permissions issue?

check the permissions of the files in relation to PHP's.

getmyuid()
getmygid()
getmyinode()
stat()

Have you talked to the host? Maybe they changed something.

Posted: Tue Feb 07, 2006 6:09 pm
by raghavan20
I am not able to get stat information for that text file...other files seem to be ok...look here

Posted: Tue Feb 07, 2006 6:13 pm
by feyd
just noticed.. you are trying to reference sampleDoc.txt but you have sampeDoc.txt notice there's no L.

Posted: Tue Feb 07, 2006 6:15 pm
by raghavan20
what a fool am I...anyway, you let me know some good Unix related commands...thanks to you...often, I have noticed that programmers spend more time on small errors which are hard to notice...