pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dash@www.rogue-penguin.com
To: pgsql-php@postgresql.org
Subject: Authentication Failure with pg_pconnect
Date: Mon, 18 Aug 2003 13:30:31 -0400 (EDT)
Message-ID: <34595.24.169.200.199.1061227831.squirrel@rogue-penguin.com> (raw)

I'm trying to get phpBB (php Bulletin Board System) running on my website
but it's install program is having problems authenticating with
postgreSQL.  I've tried to find out why it won't work and have pretty much
narrowed things down to this one function in the install script.  If the
following function doesn't seem flawed in any way, does anyone know why
php my throw this error even though username and password is correct and
user is logging in from localhost:

----
 Warning: pg_connect() [function.pg-connect]: Unable to connect to
PostgreSQL server: FATAL 1: IDENT authentication failed for user
"postgres" . in /var/www/html/phpBB2/db/postgres7.php on line 79
phpBB : Critical Error

Could not connect to the database
----

The line 79 it refers to is the line with the pg_pconnect call in the
following function:

----
	var $db_connect_id;
	var $query_result;
	var $in_transaction = 0;
	var $row = array();
	var $rowset = array();
	var $rownum = array();
	var $num_queries = 0;

	//
	// Constructor
	//
	function sql_db($sqlserver, $sqluser, $sqlpassword, $database,
$persistency = true)
	{
		$this->connect_string = "";

		if( $sqluser )
		{
			$this->connect_string .= "user=$sqluser ";
		}

		if( $sqlpassword )
		{
			$this->connect_string .= "password=$sqlpassword ";
		}

		if( $sqlserver )
		{
			if( ereg(":", $sqlserver) )
			{
				list($sqlserver, $sqlport) = split(":", $sqlserver);
				$this->connect_string .= "host=$sqlserver port=$sqlport ";
			}
			else
			{
				if( $sqlserver != "localhost" )
				{
					$this->connect_string .= "host=$sqlserver ";
				}
			}
		}

		if( $database )
		{
			$this->dbname = $database;
			$this->connect_string .= "dbname=$database";
		}

		$this->persistency = $persistency;

		$this->db_connect_id = ( $this->persistency ) ?
pg_pconnect($this->connect_string) : pg_connect($this->connect_string);

		return ( $this->db_connect_id ) ? $this->db_connect_id : false;
	}
---------


PLEASE give me a hand here, at least point me towards people who might
know more.  I need to figure this out.

A. Leigh
dash@rogue-penguin.com






view thread (5+ messages)  latest in thread

Message-ID: <34595.24.169.200.199.1061227831.squirrel@rogue-penguin.com>
Permalink:  ../34595.24.169.200.199.1061227831.squirrel@rogue-penguin.com/
Also on:    postgresql.org/message-id/34595.24.169.200.199.1061227831.squirrel@rogue-penguin.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: dash@www.rogue-penguin.com
  Subject: Re: Authentication Failure with pg_pconnect
  In-Reply-To: <34595.24.169.200.199.1061227831.squirrel@rogue-penguin.com>
  References: <34595.24.169.200.199.1061227831.squirrel@rogue-penguin.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox