Hi,

struggling with a very bizarre (to me) problem here. I am working on a windows server with IIS (2003, v6) and have an existing installation of drupal already running happily, on which I have about 6 different sites running - again, happily. Some are running under a specific domain, some under sub-domains - but all, as I say, happily.

I now want to put in place a fresh install of Drupal on a completely different IIS site. I have created the site - all good, place test HTML page in it, call up the address in my browser, get the page. So the test site is working fine, and delivering files from its own folder of course. I have a fresh MySQL database in place, all permissions set properly, user and password ditto ...

... upload the file from a fresh download of Drupal to my new site, make sure my settings.php file is there and not read only etc ... then attempt to run the install process ...

and this is where is gets really weird, because it delivers me content from one of the sites housed under the pre-existing drupal installation! How on earth? It can't be a problem in IIS because as I said, I put a test HTML file up and it was delivered correctly under the new address - still does. But in some insane way Drupal is redirecting to the other Drupal installation when delivering content ... ?!?

For one things I have no idea why this error would occur, but more importantly I have no clue HOW? How is this fresh installation even aware of another Drupal install on the server, let alone able to run files from it ... ?

Can anyone please shed even a little light on this, as I am going a little crazy here :)

Thanks in advance.

Pete McCabe

Comments

petemccabe’s picture

Hi,

no idea if relevant but should mention I make use of clean URLs with the aid of ISAPI rewrite on the first installation ... that shouldn't have any relation to this site of course, and there is no 'central' config of ISAPI rewrite in place, but as it involves redirects and being redirected seems to be at the core of my problem (somehow?!) then seemed sensible to mention it ...

vm’s picture

check settings.php it sounds like you are using a settings.php from a previous install instead of one that hasn't yet been altered and therefore it is connecting to the database that is set in $db_url

A fresh unaltered settings.php should be used by copying default.settings.php to settings.php

petemccabe’s picture

Hi,

no, absolutely not ... this is a completely fresh install, literally downloaded to local machine, unzipped, and then files uploaded ... settings.php created fresh by duplicating existing default.settings.php ... trying to run install from scratch and never even got to define MySQL db, db usr and password ... just redirects to one of sites under previous install of drupal (under totally isolated IIS site) ... like I say, totally bizarre ... but settings.php is not the problem - I haven't adjusted that file at all, just created it and made it accessible ...

vm’s picture

As far as I know, its the only reason drupal wouldn't run the install and would connect to a database. It has to be getting database connection information from somewhere and under normal circumstances it's pulled from settings.php $db_url string.

Otherwise, I'm out of ideas, suggestions and guidance.

Good Luck.

petemccabe’s picture

Hi,

OK, I deleted all the files under my new site and uploaded a fresh 6.x install again, and made no effort to set permissions properly, then tried to install by calling up the site address, and possibly got some clues ...

First time I tried to load the page, I get this:

Warning: require_once(./includes/bootstrap.inc) [function.require-once]: failed to open stream: Permission denied in C:\sites\gprintdev\www\index.php on line 15

Fatal error: require_once() [function.require]: Failed opening required './includes/bootstrap.inc' (include_path='.;C:\php5\pear') in C:\sites\gprintdev\www\index.php on line 15

Then I tried a refresh - same again. Then I refresh again, and 'bingo' I get the content from the other site / install. Still very odd, as I haven't adjusted the settings.php file ... but at least some extra weirdness to puzzle over ...

On that note, allow me to add some more specific facts about sites and server set up ...

Basically I have two site defined under IIS, with their respective files placed under different folders / paths:

Existing, functional drupal install lies under:

C:\sites\arcmulti\www

with lots of sites sitting under that in C:\sites\arcmulti\www\sites

one of which is:

C:\sites\arcmulti\www\sites\arccapital.drupal.digispin-systems.co.uk

I have a number of domain / sub-domains configured for the site under IIS, the above URL being one (arccapital.drupal.digispin-systems.co.uk) and it all works fine ...

now I have created a completely new site with this path:

C:\sites\gprintdev\www

and I have put a fresh, untouched set of drupal files under it ... and pointed a new domain at it ... with the intention of just placing that site under default (no multi site stuff this time).

so, effectively, when I point my browser that that new site I get the error above at first, but then after a couple of refreshes I get the content from:

C:\sites\arcmulti\www\sites\arccapital.drupal.digispin-systems.co.uk

which is just bonkers. I haven't at any time edited the file:

C:\sites\gprintdev\www\sites\default\setting.php

to point to the other sites database ... in fact, I haven't even CREATED that file! :)

Somehow, somewhere, some sort of redirect is taking place, yet there is no connection in IIS between the two sites and there is no accidental placement of the above addresses on the wrong site in IIS either ...

Total 'ghost in the machine' stuff ... but very frustrating ... has anyone ever experienced anything similar?

Regards,

Pete McCabe

petemccabe’s picture

Hi (again),

forgive me if I end up publicly solving this myself ... though if anyone is reading this please don't trust that I am just yet! ;)

I think I may have another clue ...

after last post I went ahead and recreated a clean settings.php file from the default.settings.php file of the new install, and reloaded the site a couple of times ... and it managed to settle on this URL:

http://gprintdev.drupal.digispin-systems.co.uk/install.php

with this error:

Fatal error: Call to undefined function drupal_init_language() in C:\sites\gprintdev\www\install.php on line 33

and my first thought was that the existing Drupal install was 5.x while the new is 6.x and it felt like while C:\sites\gprintdev\www\install.php was being run, when it was including files it was looking in the wrong place - in the pre-existing path ...

so I looked at the first include in C:\sites\gprintdev\www\install.php -> require_once './includes/install.inc';

and then renamed that file in the OTHER path:

C:\sites\arcmulti\www\includes\install.inc -> TO -> C:\sites\arcmulti\www\includes\install2.inc

and 'bingo' .... now I get this error:

Warning: require_once(./includes/install.inc) [function.require-once]: failed to open stream: No such file or directory in C:\sites\gprintdev\www\install.php on line 4

Fatal error: require_once() [function.require]: Failed opening required './includes/install.inc' (include_path='.;C:\php5\pear') in C:\sites\gprintdev\www\install.php on line 4

change it back and problem goes away ...

... so, this is a PHP path issue, yes?

But now my question is how on earth is PHP treating the other site's path as its own include path ... I haven't consciously defined that in PHP.ini etc ... ?

Any suggestions? Some sort of cache that I should know about?

Pete McCabe

petemccabe’s picture

again, forgive me if I get their myself but still post my steps ... I'm still confused, so anytime someone helps out will be greatly appreciated ... but posting what I find as I find it to see if that helps ...

still lost on the path business, but it struck me that the include path above is of the form:

require_once(./includes/install.inc)

and I wondered if somehow PHP was confused about what path to choose for /includes/install.inc then it might (yes, I was being very random here!) it might start at the base of the sites root and just keep looking until it found something that fitted (very random!) ... so I tried another test, fresh, drupal site with a path / folder name alphabetically lower / ahead of my existing site:

C:\sites\apeukdev

... dumped a fresh set of files into it (as before) and pointed a new sub-domain at it (as before) and guess what ... when I ran the install it worked perfectly! :) ...

... so the site with the alphabetically lowest name is getting preference ... truly weird, but definitely some sort of PHP include path issue, if only I knew what it was and how to fix it ...

Pete McCabe

Gorgalore’s picture

I'm having pretty much the exact same problem on my site at http://www.gorgalore.com.

I didn't see that the folders placed alphabetically made a difference. If I added a subfolder named web, however, and copied all the files of the installed Drupal site into /web, then http://www.gorgalore.com/web worked perfectly, but wouldn't work in the root. I also noticed that the require_once calls did not work when called from the root (but did from when called from web/), but if I removed the "./" from the call, then that particular call would work. So I think the problem is the same as yours somehow, but very much a ghost in the machine like you said. I think it's an IIS problem.

When I first echoed getcwd() from a php script in the root I noticed that the cwd was pointing to the inetsrv folder in the windows directory, but the same call from web/ would output the correct directory. After calling chdir() a couple times from the root, I then noticed that the cwd was defaulting to C:/, not the inetsrv directory. Totally whacko.

At one point I had a test.php script that simply changed the directory with chdir(), then echoed getcwd. No matter what, it would not output anything except the path to /web, even after I deleted the /web folder. I did something, I can't remember what now, but got it so that it would at times output the path including /web/, and other times it would just output C:/ - seemed just random, but never what I wanted.

At this point, and I'm not sure what I did exactly, I have a Drupal site running off the root. I call chdir to the web/ subfolder in index.php, and then installed Drupal files on the root and in the web/ subfolder. Now Drupal works and doesn't give an error, but looks for the sites folder in web/, but themes/ in the root directory.

A real headache. Not sure exactly what's happening.