You are here: Re: PHP doesn't access root directory using forward slash "/" « PHP Programming Language « IT news, forums, messages
Re: PHP doesn't access root directory using forward slash "/"

Posted by Jay on 09/26/81 11:54

Hi

On Windows this is not a valid Path "/test.php". If you want to test
for a file aon the
local directory use "./test.php" otherwise if you want to test for a
file on your web root you should set a specific DOCUMENT ROOT depending
on your webroot in apache. Then you could use

if(file_exists($_SERVER['DOCUMENT_ROOT']."/test.php"){
echo "Yipee;
}


Good luck


ECRIA schrieb:

> Hi All,
>
> 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.
>
> Any pointers would be greatly appreciated,
>
> Regards,
>
> ECRIA Dev. Team
>
> Details:
> Apache 2.0.52
> PHP 5.0.3
> Windows XP Pro SP2

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация