PHP & IIS - defining a path
| From: | Walter Torres | Date: | Sat, 29 Mar 2008 05:40:43 +0000 |
| Subject: | PHP & IIS - defining a path | ||
| References: | 1 2 3 4 5 6 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-28841@lists.php.net to get a copy of this message | ||
can anyone explain to me why this...
// PHP_SELF = \walter\test.php
// __FILE__ = \\NAWINFS03\home\web\rh.itdoes\walter\test.php
// $_path = \\NAWINFS03\home\web\rh.itdoes
$_path = substr( __FILE__, 0, 0-strlen($_SERVER['PHP_SELF']) );
require_once $_path . DIRECTORY_SEPARATOR . 'config.php';fails...
Fatal error: main(): Failed opening required [file as defined in $path]And yes, $path echos what I expect it to. But this, hard coded definition...
$path = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR .
'NAWINFS03' . DIRECTORY_SEPARATOR .
'home' . DIRECTORY_SEPARATOR .
'web' . DIRECTORY_SEPARATOR .
'rh.itdoes';
require_once $_path . DIRECTORY_SEPARATOR . 'config.php';This works fine! ?? But this coded version will *not* work if I use '\' (yes, even escaped). I really need to get $path dynamically defined. Can anyone shed some light on this? (Beyond "don't use IIS") Thanks Walter