Jump to content


Photo

Multiple Domains with Different PHP Document Roots?


  • Please log in to reply
1 reply to this topic

#1 elliterate

elliterate
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 24 March 2006 - 12:22 AM

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 dev domain, it loads the corresponding .php file in the www 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.0
Microsoft Windows Server 2003, Standard Edition
PHP 5.0 (tried both CGI and ISAPI)

#2 timg

timg
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 19 April 2006 - 03:43 PM

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).

hth

tim

[!--quoteo(post=357809:date=Mar 23 2006, 07:22 PM:name=elliterate)--][div class=\'quotetop\']QUOTE(elliterate @ Mar 23 2006, 07:22 PM) View Post[/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 dev domain, it loads the corresponding .php file in the www 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.0
Microsoft Windows Server 2003, Standard Edition
PHP 5.0 (tried both CGI and ISAPI)
[/quote]





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users