PHP File Exists Always False

Posted by Joe on Stack Overflow See other posts from Stack Overflow or by Joe
Published on 2009-11-25T19:59:54Z Indexed on 2010/04/02 8:03 UTC
Read the original article Hit count: 442

Filed under:
|
|
|

I have a case where file_exists() is always returning false. My latest attempt was to just test to see if it would return true for $_SERVER["SCRIPT_FILENAME"] and then return the value of the path if it couldn't find the file which it does.

The path while not necessarily relevant to solving the problem is: /Users/joe/Workspace/720/app/webroot/index.php

I have obviously verified that the file is there, and am not even sure how it couldn't be there since php is serving it up.

I should mention this is on an install of OS X Snow Leopard running PHP 5.3.0.

Any ideas would be fantastic.

CODE SAMPLE:

if (!file_exists($_SERVER["SCRIPT_FILENAME"]))
    $errors[] = 'Cant find:'. $_SERVER["SCRIPT_FILENAME"];

© Stack Overflow or respective owner

Related posts about php

Related posts about file-exists