Forum Moderators: open

Message Too Old, No Replies

Application/virtual directory relative path problems

works fine from wwwroot but NOT from application virtual dir

         

badbadmonkey

7:47 am on Jun 28, 2008 (gmt 0)

10+ Year Member



PHP 5 on IIS7, ISAPI (not CGI).
Please note: not ASP, not CGI... this affects the options I can play with in IIS...

I am having big problems with relative path references in my scripts. include()s and file handlers fail with "no such file" errors.

These references usually refer to some file in a subdir relative to the current script. I.e.
include("includes/script.php")
Occasionally, from a current script also in a subdir...
include("../includes/script.php")

The problems occur with the site as an application or virtual directory (I have tried both) with virtual path site/ in both cases.

It works fine if the site is copied to c:\wwwroot\site\
So I know it is not a PHP issue per se.

To be clear, in the former case, localhost/site fails, but in the latter case, localhost/site is fine.

The exact same script also worked fine in a virtual directory under IIS6. I am trying to set it up just the same on a new system.

Help?

badbadmonkey

10:43 am on Jun 30, 2008 (gmt 0)

10+ Year Member



Well the fopen() errors turned out to be a permissions thing with adminHost.config...

But includes STILL fail. Anyone got any ideas? Considering the site works just fine in a subdir of wwwroot, but not the application [virtual dir], I figure it's gotta be an IIS issue...?