Re: file_exists alway returns false

From: Phil Powell (phillip.s.powell_at_gmail.com)
Date: 11/09/04


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>");
> }
> #############################################
> ?>



Relevant Pages

  • file_exists alway returns false
    ... I've got two linux boxes running redhat9 and either PHP Version 4.2.2 ... The file structure is set up the same on both ... on both machines seq_tables is a symbolic link to another location. ... or single quotes when asigning a value to $filename. ...
    (comp.lang.php)
  • Re: How to modify program files in Vista?
    ... create it within HKLM and change the permissions. ... INI files have the advantage that most users with access to notepad can ... Security policies ... We were writing a module that validated device drivers found on target machines against ...
    (microsoft.public.vc.mfc)
  • Re: Windows user controls in a web page: Security
    ... I then tried on more machines (I was using 3 real ... Create a windows user control, ... Select the permissions your control will need and then click "Add ... use "URL", for example, to only authorize assemblies coming from one URL. ...
    (microsoft.public.dotnet.security)
  • Re: Publishing Software...
    ... I may have to recant my thoughts about it being a permissions issue, ... domain workstation security policy and then lock it down and reapply that. ... >> Are the users on the machines in question, members of the local Administrators group?? ... >> User Rights configuration was completed with one or more errors. ...
    (microsoft.public.windows.server.sbs)
  • Re: ubuntu xp vmware cluster f...er...filesharing
    ... virtual machines. ... The common workspace should be accessible no matter ... I've tried the built-in file sharing but it fails because permissions ... I tried Samba but I could not get ubuntu to consistently ...
    (Ubuntu)