Unable to connect to database.
Permalink
We have built a new concrete 5 website, we have the domain name on another hosting company and we then point the www records to our 1 and 1 account.
We 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
We 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
Did you make a copy of your database and put it on the target server using the same database name, user and password? I think C5 can't find your MySQL database. Use phpmyadmin or some other MySQL admin tool to make sure your database and user exists.
all we have done is alter the site.php file in config. The site was working prior to this, but the url was still redirecting to the testing space!
If using pretty URL's, check your .htaccess file. Should see:
RewriteBase /
Hi
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
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
Not sure, but I don't think so. My first "gut instinct" says there is a problem with your database. One or more of these lines is incorrect:
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.
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.
Hi
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!
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!
It appears your test server and live server are in different places.
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?
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?
You should also clear your cache files in /files/cache/*
How do I clear the cache if I can't get into the site through the admin. Is there a way through ftp?
Yes. FTP is most likely your only method of access.
OK ... so how do I clear the cache through ftp? Any ideas?
It's easier to clear the cache through the C5 dashboard. That's not preventing you from connecting to your database. I think that is your primary problem.
I think the point here, is that you haven't just changed your site.php. From reading through this thread it looks like you have moved your site from your testing server to your live server. Is this correct?
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).
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).
Hi Guys,
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
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
Excellent! Glad you got it working.