Unable to connect to database.
PermalinkWe built the site in a testing area, then we began transferring the site over so we pointed to our 1 and 1 account. however when you typed the correct domain address it resorted tohttp://www.s248611434.websitehome.co.uk... instead of being (http://www.4ti.co.uk).
so we edited the config.php file to change the details over. We changed our config.php from:
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'web85-a-concr-44');
define('DB_PASSWORD', '2-wDDzqmJ');
define('DB_DATABASE', 'web85-a-concr-44');
define('BASE_URL', 'http://79.170.44.85');
define('DIR_REL', '/4ti.co.uk');
define('PASSWORD_SALT', 'iPBveTcvx3PhteLPwxRZDI6EKeaeGsICFGoj4r6cP8FFYh8yiMAqKcHbLvWRzpjH');
define('SERVER_PATH_VARIABLE', 'REDIRECT_URL');
to...
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'web85-a-concr-44');
define('DB_PASSWORD', '2-wDDzqmJ');
define('DB_DATABASE', 'web85-a-concr-44');
define('BASE_URL', 'http://4ti.co.uk');
define('DIR_REL', '');
define('PASSWORD_SALT', 'iPBveTcvx3PhteLPwxRZDI6EKeaeGsICFGoj4r6cP8FFYh8yiMAqKcHbLvWRzpjH');
define('SERVER_PATH_VARIABLE', 'REDIRECT_URL');
Now when we access the site we get the following error is their something that we have done wrong in the config.php...?
Here is the error that we are getting on 4ti.co.uk
Unable to connect to database.
A database error occurred while processing this request.
Catchable fatal error: Argument 1 passed to ConfigStore::__construct() must be an instance of Database, null given, called in /homepages/27/d248611415/htdocs/4titude/concrete/models/config.php on line 48 and defined in /homepages/27/d248611415/htdocs/4titude/concrete/models/config.php on line 136
Could someone please help with this dilemma...
Regards Simon

RewriteBase /
We have just checked out htaccess file and it seems as though we
already have this written:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule .* index.php [PT,QSA,L]
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
AddType x-mapp-php5 .php
could this be the problem.
Regards Simon
uniting brand & personality by design // branding // print // web
contact //01737 226600 //http://www.knibbs.co.uk
I'm a linux person so my knowledge base on windows is limited. You can try "127.0.0.1" instead if "localhost". Also, using a MySQL admin tool check that your database and username exists and the password is correct.
Just tried replacing that and still no joy. The site was working fine this morning! How can just changing the site.php file and then changing it back to how it was have such an impact? Not sure what to do now!
Test server = 79.170.44.85
Live server = 4ti.co.uk. = 82.165.217.56
DNS issue? Did you copy your database to the server at 82.165.217.56?
But the site.php was still redirecting everyone to the copy of the site on your test server. So you updated your site.php to ensure people stayed on the live site. Is this correct?
If so, after updating your site.php, this would be the first time your live site had actually tried to fully load. And as nteaviation has pointed out, if your db information in site.php is not the correct information for your live site (which it probably isn't) then your site would go down with a db error.
If you're completely stuck on this, then pm me and I'll see if I can sort it for you. I'm UK based.
Jon
P.S. to clear your cache without dashboard access, ftp into your site and delete all the files in /files/cache/ (not the actual folder, just the contents).
Yes you were correct, we had to alter the site.php file with the correct database information and this fixed the site and also now the urls are all correct and not showing the IP address as was the case previously.
Thanks