PHP & IIS - defining a path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux