Hi, I'm pretty new (I started this yesterday) So far I've installed a Commerce Kickstart distribution on a local host using an old version of Wampserver. I want to keep the demo site that comes with CK up and running for a while to learn from it so I wanted to create a different site using the same Drupal installation for my actual real website which I'll eventually link up to my registered domain.

So... I've looked at a lot of answers and I've:
1) created a new database
2) created a new folder in the sites/ folder
3) copied the defaultsettings.php in there
4) changed its name to settings.php
5) checked that it's writable.

it seems all i have to do now is edit the settings.php file and then I can install.... BUT every post seems to say I need to change the " $db_url " part in the new settings.php file I've created. But it doesn't exist! Help!

I'm unsure as to how to direct it to the new database (which I presume this is for) and once that's done, how I'll know what url to put in to find the site here locally and install on it.

I've been looking for a solution for hours... :(

Comments

The Slave's Dream’s picture

STILL not figured out the problem above but saw a few posts mentioning the apache virtual host so decided to try it as a further step I thought I missed - but now messed up completely and url for local host won't even open :(

Basically I followed the instructions here http://www.adastra.ca/blog/how-drupal-multisite-windows-localhost

1. First I ENABLED the virtual host? So this is what I did:

Opened C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf in Notepad (my version of Apache is 2.2.11).

Remove the # before Include conf/extra/httpd-vhosts.conf, as follows:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

2. Secondly I needed to ADD the virtual host? So this is what I did:


DocumentRoot c:/wamp/www/drupalCKdistro
ServerName examplesitename1


DocumentRoot c:/wamp/www/drupalCKdistro
ServerName examplesitename2


DocumentRoot c:/wamp/www
ServerName localhost

3. Thirdly I needed to add the virtual host? So this is what I did:

Open C:/Windows/System32/drivers/etc/hosts in Notepad and add these lines after 127.0.0.1 localhost, as follows:

# 127.0.0.1 localhost
# ::1 localhost

127.0.0.1 examplesitename1
127.0.0.1 examplesitename2

Don't know what I've done :( Help!

johnmcgov’s picture

So one of the interesting this here is that $db_url is a Drupal 6 setting. Drupal 7 uses a different settings array for the DB config. I am wondering if you are installing a D7 distro in a D6 multi site environment and having issues related to that. I don't believe there is Drupal Commerce for D6.

I hope that is of some help!

John

The Slave's Dream’s picture

Thanks for getting back to me John, I was beginning to feel rather lonely!

I've downloaded the Commerce Kickstart distribution which is the 7.x-2.0

How might it be possible that I'm using a D6 multi site environment? I think it's more that I'm looking at all the guidance which suggests I change the settings.php file by changing the $db_url

What do you suggest I do instead?

PS I went back and changed step one in the apache directions I listed above, ie I put the # back, and my site reappeared. Phew!

johnmcgov’s picture

Do you have this part of the config in the config file. This is the D7 equivalent. Maybe try that instead?

$databases = array('default' => array('default' => array(
    'driver' => 'mysql',
    'database' => 'dbname',
    'username' => 'username',
    'password' => 'password',
    'host' => '127.0.0.1',
    'port' => 33066 )));
The Slave's Dream’s picture

Thanks John, had tried copying the example.sites file and making a new sites file which I edited as advised by some answers, no luck, so when I saw your message I just deleted that sites file and tried changing the above in the settings.php file of my sites/examplesite folder - no luck :( all i changes was the dbname to put in the name of the one I'd created.

Now when I go to the root site on the local host (ie where drupal is installed) i can't even see the commerce kickstart demo anymore, instead I get this PDOException: SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'localhost' (10061) in db_table_exists() (line 2732 of C:\wamp\www\drupalCKdistro\includes\database\database.inc).

Any ideas? I'll keep searching...

The Slave's Dream’s picture

I don't know how but it's installed :)

It's not exactly where I'd want it to be it works! I basically did what you said and played around until something happened, thank-you.

Strange this is now if I put localhost/drupalCKdistro (where I installed drupal) into my address bar I get my installed demo site that I had originally, and if I go to examplesitename/drupalCKdistro I find my new site which I've just installed without the demo site.

Weird! But it works :) Now to put some content on and connect it to the net!

johnmcgov’s picture

Great! I am glad you got it working.