Database connection problem when installing on Ubuntu LTS 10.04


(Niels Klazenga) #1

We have installed Matrix on an Ubuntu LTS 10.04 server. After negotiating all installation steps without major issues, we get the following error message when trying to open Matrix in the browser:


<br />

<b>Fatal error</b>: Uncaught exception 'Exception' with message 'Could not create database connection: DBError!:SQLSTATE[08006] [7] could not connect to server: No such file or directory

Is the server running locally and accepting

connections on Unix domain socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot;?' in /var/www/matrix/core/include/mysource.inc:2635

Stack trace:

#0 /var/www/matrix/core/include/mysource.inc(211): MySource-&gt;changeDatabaseConnection('db')

#1 /var/www/matrix/core/include/init.inc(233): MySource-&gt;init()

#2 /var/www/matrix/core/web/index.php(28): require_once('/var/www/matrix…')

#3 {main}

thrown in <b>/var/www/matrix/core/include/mysource.inc</b> on line <b>2635</b><br />



Apparently there is a database connection problem. For some reason, I can connect to the database fine from the command line, as was done in the step02.php script, but not from within the browser. I am a MySQL person and have very little experience with PostgreSQL. Would someone be able to tell me what is going on and where we went wrong? It should be fairly easy to repeat the installation, if necessary, once we get PostgreSQL set up and configured correctly.



Niels Klazenga, Royal Botanic Gardens Melbourne


(Anthony Barnes) #2

If the install scripts worked for you, then the problem may lie in the permissions. I've spoken with one of our System Administrators and there is an option in pg_hba.conf to trust local connections, and also to setup postgres users that are allowed to make connections. If this somehow set to use the OS user, it would explain working on the command line as opposed to when you use the backend (apache user).


(Dan Simmons) #3

Can you post the contents of /etc/postgresql/8.4/pg_hba.conf and /var/www/matrix/data/private/conf/db.inc?


(Arekczer) #4

[quote]
We have installed Matrix on an Ubuntu LTS 10.04 server. After negotiating all installation steps without major issues, we get the following error message when trying to open Matrix in the browser:



<br />

<b>Fatal error</b>: Uncaught exception 'Exception' with message 'Could not create database connection: DBError!:SQLSTATE[08006] [7] could not connect to server: No such file or directory

Is the server running locally and accepting

connections on Unix domain socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot;?' in /var/www/matrix/core/include/mysource.inc:2635

Stack trace:

#0 /var/www/matrix/core/include/mysource.inc(211): MySource-&gt;changeDatabaseConnection('db')

#1 /var/www/matrix/core/include/init.inc(233): MySource-&gt;init()

#2 /var/www/matrix/core/web/index.php(28): require_once('/var/www/matrix…')

#3 {main}

thrown in <b>/var/www/matrix/core/include/mysource.inc</b> on line <b>2635</b><br />



Apparently there is a database connection problem. For some reason, I can connect to the database fine from the command line, as was done in the step02.php script, but not from within the browser. I am a MySQL person and have very little experience with PostgreSQL. Would someone be able to tell me what is going on and where we went wrong? It should be fairly easy to repeat the installation, if necessary, once we get PostgreSQL set up and configured correctly.



Niels Klazenga, Royal Botanic Gardens Melbourne

[/quote]

Hi,

Try add to /etc/postgresql/8.4/main/pg_hba.conf this lines:

    
    local   mysource_matrix_db matrix_user                    trust
    local   mysource_matrix_db matrix_secondary_user              trust


Arek

(Niels Klazenga) #5

Thanks people,
This particular issue has been resolved. It turns out postgresql did not start, because of the incorrect permissions, as you suggested. We now have a php problem for which there is already a forum entry. Have decided that Ubuntu 10.04 may be just a bit too hard. Will try RedHat first.



Niels