|
Posted by Andy Hassall on 11/22/40 11:54
On Tue, 1 Aug 2006 07:57:43 -0400, "ECRIA" <php_file_problem@ecria.com> wrote:
>We are trying to figure out why PHP's file handling functions refuses to
>access the web root using the "/" character on our Windows machines. For
>example, a file /test.php is located in our web root. A file in a
>subdirectory, say /example/runme.php needs to find out if the file
>"/test.php" exists. One would expect that the function
>file_exists("/test.php") would return true (it does on our unix host).
>However, it returns false on our Windows machine.
>
>Unfortunately we can't build a workaround as it is not us but oscommerce
>that uses the "/" method to refer to the web root, and modifying all the
>oscommerce scripts is simply impractical.
file_exists works in the filesystem space, not the URL space of the webserver.
"/" never refers to the web root (unless your webserver was chroot'ed to the
web root, which would be unusual); it's the filesystem root.
On Windows this is further complicated because there are multiple roots, one
per drive; "/" is a relative path on Windows, not an absolute path - relative
to the drive of the current working directory.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|