Skip site navigation (1) Skip section navigation (2)

Re: Authentication Failure with pg_pconnect

From: "David Busby" <busby(at)pnts(dot)com>
To: <dash(at)melchior(dot)rogue-penguin(dot)com>, <pgsql-php(at)postgresql(dot)org>
Subject: Re: Authentication Failure with pg_pconnect
Date: 2003-08-18 23:12:50
Message-ID: 023901c365de$3f3419b0$1100000a@busbydev (view raw or flat)
Thread:
Lists: pgsql-php
this doc has something for you in the "notes" section.
http://www.edoceo.com/liberum/?doc=postgresql


----- Original Message ----- 
From: <dash(at)melchior(dot)rogue-penguin(dot)com>
To: <pgsql-php(at)postgresql(dot)org>
Sent: Monday, August 18, 2003 10:30
Subject: [PHP] Authentication Failure with pg_pconnect


> 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(at)rogue-penguin(dot)com
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)


In response to

pgsql-php by date

Next:From: Cody PhanekhamDate: 2003-08-19 02:32:37
Subject: Securing PHP scripts
Previous:From: Joe Nilson Zegarra GalvezDate: 2003-08-18 19:54:18
Subject: test

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group