|
Posted by Gordon Burditt on 09/13/05 18:30
Relative paths are interpreted with respect to the current
directory.
>I'm trying to read a file with PHP:
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).
>--------------------
>$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
>another
>directory.
What error message do you get when it fails? (Turn on error_reporting
if it's not already).
Gordon L. Burditt
Navigation:
[Reply to this message]
|