How to connect the postgresql when to install the drupal?

March 20, 2015 5.4k views
Drupal Debian PostgreSQL

I want to install drupal7 congifiguration with postgresql9 .

  1. to install drupal files as the following steps.
tar zxvf drupal-7.15.tar.gz 
sudo mv drupal-7.15/* /var/www/
cd /var/www/
cp sites/default/default.settings.php sites/default/settings.php
chmod a+w sites/default/settings.php
chmod a+w sites/default
  1. to install postgresql database
createuser --pwprompt --encrypted --no-adduser
--no-createdb username
createdb --encoding=UNICODE --owner=username databasename
  1. to input my_domain in firefox ,it ran accross the message:

alt text

1 comment
  • I used the information here, but since I have postgresql96, I get the response “Failed to connect to your database server. The server reports the following message: SQLSTATE[08006] [7] FATAL: Ident authentication failed for user "drupal1”. Postgres is running and I can sign in with psql with the username and password in sites/default/settings.php.

1 Answer

It’s not very intuitive, but the real problem is not the big red error message. It’s the smaller text:

The type of database your Drupal data will be stored in. Your PHP configuration only supports a single database type, so it has been automatically selected.

You don’t seem to have the Postgres PHP extension installed, so Drupal is not detecting your Postgres instance. The error is it trying to connect to MySql. You can install it with:

  • sudo apt-get install php5-pgsql

Once that is installed, you should now be able to select Postgres as your database.

drupal & postgres <3

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!