pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Borg <osgiliath@consultant.com>
To: Jeff Self <jself@ci.newport-news.va.us>
Cc: pgsql-php@postgresql.org
Subject: Re: Not able to connect to server from PHP
Date: 23 Jan 2002 09:39:27 +1100
Message-ID: <1011739167.1422.2.camel@p1g.osgiliath> (raw)
In-Reply-To: <FA94456F-0F81-11D6-8241-00306569F51E@earthlink.net>
References: <FA94456F-0F81-11D6-8241-00306569F51E@earthlink.net>

In addition to that, check you pg_hba.conf file for restrictions to
using the db over ip.

Rgds,
Stephan

On Wed, 2002-01-23 at 08:49, jeff fitzmyers wrote:
> I'm not sure, but you might try: CREATE USER www-data;
> and then give the user permissions for the table:
> GRANT INSERT,SELECT,UPDATE ON "personnel" TO "www-data";
> 
> jeff
> 
> 
> On Tuesday, January 22, 2002, at 01:18 PM, Jeff Self wrote:
> 
> > Ok, I tried this and this is the error message I get now:
> >
> > Warning: Unable to connect to PostgreSQL server: FATAL 1: user
> > "www-data" does not exist in /var/www/personnel/include/database.inc on
> > line 9
> > Could not connect to database.
> >
> > www-data is the user and group for apache. I don't know what to make of
> > this.
> >
> > Here's my database.inc file:
> >
> > <?php
> > //
> > // database.inc
> > //
> > // Database Information
> >
> > 	$dbname = "personnel";
> >
> > 	$conn = pg_pconnect("host=localhost port=5432 dbname=$dbname");
> > 	if (!$conn) {
> > 		echo "Could not connect to database.";
> > 		exit;
> > 	}
> > ?>
> >
> >
> > On Tue, 2002-01-22 at 15:54, timothy_maguire@hartehanks.com wrote:
> >>
> >> When I connect I don't like to use the user name attribute.  You might 
> >> also
> >> want to try the port attribute.
> >>
> >> Try something like this:
> >>
> >> $conn =pg_connect("host=localhost port=5432 dbname=personnel") or die
> >> ("unable to connect to Internal DB");
> >>
> >> Tim.
> >>
> >> Timothy P. Maguire
> >> Web Developer II
> >> Harte-Hanks
> >> 978 436 3325
> >
> > --
> > Jeff Self
> > Information Technology Analyst
> > Department of Personnel
> > City of Newport News
> > 2400 Washington Ave.
> > Newport News, VA 23607
> > 757-926-6930
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> >
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
-- 
ÿþS




view thread (8+ messages)  latest in thread

Message-ID: <1011739167.1422.2.camel@p1g.osgiliath>
Permalink:  ../1011739167.1422.2.camel@p1g.osgiliath/
Also on:    postgresql.org/message-id/1011739167.1422.2.camel@p1g.osgiliath

 · 

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: osgiliath@consultant.com, jself@ci.newport-news.va.us
  Subject: Re: Not able to connect to server from PHP
  In-Reply-To: <1011739167.1422.2.camel@p1g.osgiliath>
  References: <FA94456F-0F81-11D6-8241-00306569F51E@earthlink.net> <1011739167.1422.2.camel@p1g.osgiliath>

* 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