Unable to connect to connection "db"


(Nic Hubbard) #1

I am doing an installation and ran into an error that I have never seen before.

 

When running step_02.php I get the error:

 

 

Fatal error: Uncaught exception 'Exception' with message: 'Unable to connect to connection "db". No connection with that name is defined in the database config.

 

It also prints out the contents of my db.inc file:

 

 

$db_conf = array (
        'db' => array (
                'DSN' => 'pgsql:dbname=squiz_matrix',
                'user' => 'matrix',
                'password' => '',
                'type' => 'pgsql',
               ),
        'db2' => array (
                'DSN' => 'pgsql:dbname=squiz_matrix',
                'user' => 'matrix',
                'password' => '',
                'type' => 'pgsql',
               ),
        'db3' => array (
                'DSN' => 'pgsql:dbname=squiz_matrix',
                'user' => 'matrix_secondary',
                'password' => '',
                'type' => 'pgsql',
               ),
        'dbcache' => NULL,
        'dbsearch' => NULL,
        );

return $db_conf;
 

 

Not sure why it is doing that.

 

Any ideas on what this error means?


(Marcus Fong) #2

Hi, Nic.

I can reproduce your error if I remove the first line from db.inc. The first line, before the line with “$db_conf = array (” should be:


<?php


(Nic Hubbard) #3

I can reproduce your error if I remove the first line from db.inc. The first line, before the line with "$db_conf = array (" should be:
<?php

 

Ha! Thank you!

 

Seems like I should have noticed that the opening and closing tags were removed when I was missing with that file.

 

Thanks!