I really hoped that this day would never come, but I've been charged with setting up PHP5 on the dreaded Microsoft IIS Web server.
Everything went pretty smooth with one exception: relative file includes are not working... at all.
Suppose the directory structure is like this:
/ (this is the root of the site and is located at D:\mysite)
/includes
If I create a PHP file at the root of the IIS site, this works:
include_once('D:\mysite\includes\include.inc.php');
But if I try this, it fails:
include_once('includes/include.inc.php');
//This fails, too:
//include_once('./includes/include.inc.php');
It's like IIS is incorrectly composing the relative path locations. Has anyone run into this problem before? I found several similar posts, but not a one had any kind of acceptable answer.
Thanks!
* EDIT *
I just discovered that this issue ONLY occurs when I change my site's root folder from IIS's default directory (which is C:\Inetpub\wwwroot). Here's where it gets weird. I had everything working fine and then moved my site from C:\Inetpub\wwwroot to D:\mysite. And when I say moved, I created a new folder on D:\ and copied all of the PHP files to the newly-created folder. Then I had all the problems with includes and path errors. Then, I gave up and deleted D:\mysite and for testing purposes, duplicated C:\Inetpub\wwwroot and renamed it to C:\mysite and EVERYTHING WORKS.
IIS is really busting my balls here. Why is this happening? Is it a permissions thing? As far as IIS is concerned, whether I define my site's root as the default (C:\Inetpub\wwwroot) or not shouldn't make a bit of difference as far as PHP's functionality goes... but it is! What gives?!
* EDIT *
WHAT THE!? This is just nuts.
If I create a folder on D: with the same name as the IIS default, IT WORKS. D:\Inetpub\wwwroot works. But D:\Inetpub\anything_else does NOT work. And if I set the root of the site to be ANYWHERE on C:, it works. I'm ready to jump out a window.