Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
September 13, 2005, 3:19 pm
rate this thread
$fileToRead = "foo.txt"; //Option-1
#$fileToRead = "/home/frank/otherdir/foo.txt"; //Option-2
$dataFile = fopen($fileToRead, "r") ;
Option-1 works but Option-2 doesn't, but 'foo.txt' is COMPULSORY within
What can I do? Regards.
Re: Does 'fopen' work only within the same directory?
Is safe mode on? Does the *user running PHP* (it's a fairly safe
bet this is *NOT* 'frank', but more likely 'www', 'apache', 'nobody86'
or 'daemon') have permission to open the file (that means permissions
on /, /home, /home/frank, /home/frank/otherdir, and
/home/frank/otherdir/foo.txt have to be appropriate).
What error message do you get when it fails? (Turn on error_reporting
if it's not already).
Gordon L. Burditt