elliterate Posted March 24, 2006 Share Posted March 24, 2006 That's my best guess.We have two domains, one technically a sub-domain of the other, but both are document-rooted at E:\. One is E:\www.example.com\ while the other is E:\dev.example.com\. We've created two separate websites in the IIS Manager, one for each domain, setting the Document Root appropriately for each one.For some reason, however, when we load a .php file in the [i]dev[/i] domain, it loads the corresponding .php file in the [i]www[/i] domain. If the .php is in both dev and www, we can reach it in the browser at either domain. If it is missing from the dev site, it will only be visible in the www domain. If it is only missing from the www site, it won't be visible to either site, even if it's still in the dev site.Go figure.When I try and view phpinfo() from a webpage, it reveals that, while all other parameters are correct, the document root is always set to E:\www.example.com\, no matter what domain I'm looking at. I went into the php.ini file and, lo-and-behold, the doc_root parameter is set to E:\www.example.com\. When I set it to E:\dev.example.com\, everything I've previously described continues to happen, but in the other direction. So if you go to www.example.com/index.php, it loads dev.example.com/index.php locally while retaining the www URL in your address bar.When I comment out the doc_root completely from php.ini, it's as if it was still set to E:\www.example.com, the only difference being it no longer shows up in the phpinfo() output.Any idea what's causing this problem?(I really ned to be able to keep their directory structures separate -- not have one be a sub-folder of the other -- to obtain proper development environment separation.)--Stats:IIS 6.0Microsoft Windows Server 2003, Standard EditionPHP 5.0 (tried both CGI and ISAPI) Quote Link to comment https://forums.phpfreaks.com/topic/5646-multiple-domains-with-different-php-document-roots/ Share on other sites More sharing options...
timg Posted April 19, 2006 Share Posted April 19, 2006 if you want multiple domains eg: d:\site1, d:\site2 etc etc just leave the doc_root blank, restart IIS and hey presto php all over the place (took me a while to wok it out).hthtim[!--quoteo(post=357809:date=Mar 23 2006, 07:22 PM:name=elliterate)--][div class=\'quotetop\']QUOTE(elliterate @ Mar 23 2006, 07:22 PM) [snapback]357809[/snapback][/div][div class=\'quotemain\'][!--quotec--]That's my best guess.We have two domains, one technically a sub-domain of the other, but both are document-rooted at E:\. One is E:\www.example.com\ while the other is E:\dev.example.com\. We've created two separate websites in the IIS Manager, one for each domain, setting the Document Root appropriately for each one.For some reason, however, when we load a .php file in the [i]dev[/i] domain, it loads the corresponding .php file in the [i]www[/i] domain. If the .php is in both dev and www, we can reach it in the browser at either domain. If it is missing from the dev site, it will only be visible in the www domain. If it is only missing from the www site, it won't be visible to either site, even if it's still in the dev site.Go figure.When I try and view phpinfo() from a webpage, it reveals that, while all other parameters are correct, the document root is always set to E:\www.example.com\, no matter what domain I'm looking at. I went into the php.ini file and, lo-and-behold, the doc_root parameter is set to E:\www.example.com\. When I set it to E:\dev.example.com\, everything I've previously described continues to happen, but in the other direction. So if you go to www.example.com/index.php, it loads dev.example.com/index.php locally while retaining the www URL in your address bar.When I comment out the doc_root completely from php.ini, it's as if it was still set to E:\www.example.com, the only difference being it no longer shows up in the phpinfo() output.Any idea what's causing this problem?(I really ned to be able to keep their directory structures separate -- not have one be a sub-folder of the other -- to obtain proper development environment separation.)--Stats:IIS 6.0Microsoft Windows Server 2003, Standard EditionPHP 5.0 (tried both CGI and ISAPI)[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/5646-multiple-domains-with-different-php-document-roots/#findComment-28620 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.