Re: file_exists alway returns false
From: Phil Powell (phillip.s.powell_at_gmail.com)
Date: 11/09/04
- Next message: Justin Tang: "Error in trying to pass large amount of data in textarea?"
- Previous message: jrf[no]: "Re: Does PHP need the .php extension ?"
- In reply to: annie: "file_exists alway returns false"
- Next in thread: annie: "Re: file_exists alway returns false"
- Reply: annie: "Re: file_exists alway returns false"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Nov 2004 09:22:52 -0800
bahhab@hotmail.com (annie) wrote in message news:<5b4ae9b7.0411090222.51fd841c@posting.google.com>...
> Hi
>
> I've got two linux boxes running redhat9 and either PHP Version 4.2.2
> or PHP Version 4.3.7. The file structure is set up the same on both
> machines and both files exist. The problem is not file specific and
> on both machines seq_tables is a symbolic link to another location.
>
> It makes no difference to either version of php whether I use double
> or single quotes when asigning a value to $filename. Nor does it
> matter whether I use single or double, forward(/) or back(\) slashes
> in the path.
>
> I don't use open_basedir in either php.ini file so this warning
> doesn't apply. 'If you use open_basedir in php.ini and use file_exists
> for file outside open_basedir path, you will not be warned at log and
> file_exists returns false even if file really exists.'
>
> So what else could cause the file to be found on the 4.2.2 version but
> not on the 4.3.7 version? Any hints will be much appreciated.
>
> Annie
>
This might sound a bit simplistic, but did you verify if the file
exists via command-line? "ls -l ../myfile"? Also check permissions
on the file, if Apache (or whatever webserver you use) has no
permissions to at least read that file you could return a false on
file_exists() even though the file really does exist (I have run into
that in the past).
Phil
>
>
>
> <?php
>
> #####test script############################
> $filename = '/var/www/html/seq_tables/lumbricus/sequences/CF610635';
>
> if (file_exists($filename)) {
> print("The file $filename exists<br>");
> } else {
> print("The file $filename doesn't exists<br>");
> }
> #############################################
> ?>
- Next message: Justin Tang: "Error in trying to pass large amount of data in textarea?"
- Previous message: jrf[no]: "Re: Does PHP need the .php extension ?"
- In reply to: annie: "file_exists alway returns false"
- Next in thread: annie: "Re: file_exists alway returns false"
- Reply: annie: "Re: file_exists alway returns false"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|