LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: Walter Torres Date: Fri Mar 28 23:40:43 2008 Subject: PHP & IIS - defining a path
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
| Navigate in group php.windows at sever news.php.net | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |