Jump to content

PHP works fine on default site but not on additional sites using host headers..?


angelleye

Recommended Posts

I've got a test server setup at sandbox.mydomain.com on Win2k3 with IIS 6.  I've got PHP installed on this server and it works great on the default web site in IIS.

 

I've always had my client web sites under /client-sites on my default web site.  The problem with this is that when my clients are using things like ./ in their links it goes back up to my actual root instead of their site's root (ie. sandbox.mydomain.com/client-sites/site-name). 

 

To fix this I've gone ahead and created additional A records in my DNS to point other sub-domains to my test server (ie. client.mydomain.com) and then I created a new site in IIS and applied the host header value of client.mydomain.com. 

 

With that I can successfully browse the client's site via http://client.mydomain.com, however, PHP does not work on these additional sites.  It still works great on my default site in IIS, just not on any of the extra sites I add this way.  I can browse HTML files, txt files, images, etc. just fine but anything PHP just gives me page not found.

 

Any information on how I can make PHP work with ALL sites in IIS instead of just the default would be greatly appreciated. Thanks!

Link to comment
Share on other sites

Yes, the host header is needed because I'm hosting more than 1 site on the same IP address and the same port.  That part is all working fine. 

 

I've figured out that when I comment out the doc_root in php.ini then PHP pages will indeed load on the sites, however, all of my relative links to includes like css, js, etc. aren't working when I do that. 

 

Apparently what I need is to specify separate php.ini files for each site, or specify multiple doc_root's in a single php.ini file.  Possible..??

Link to comment
Share on other sites

  • 3 months later...

 

dear all

we found the solution  .. 

For this who are interested

to make it works we need to configure the .php extension (in my case to php5isapi.dll) for each web sites which is using PHP

I did in the past for the default web site but forgot to do it for new ones

take care

Link to comment
Share on other sites

 

dear all

we found the solution  .. 

For this who are interested

to make it works we need to configure the .php extension (in my case to php5isapi.dll) for each web sites which is using PHP

I did in the past for the default web site but forgot to do it for new ones

take care

 

You can actually configure this on all sites by doing it at the very top of the websites tree within IIS.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.