Re: Not able to connect to server from PHP

From: Jeff Self <jself(at)ci(dot)newport-news(dot)va(dot)us>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: Not able to connect to server from PHP
Date: 2002-01-23 13:57:11
Message-ID: 1011794231.19776.1.camel@personnel_test
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Thanks for the tips everyone. I figured it out this morning. My
pg_hba.conf file had local set to peer sameuser instead of trust. I
don't know how that happened.

On Tue, 2002-01-22 at 16:11, timothy_maguire(at)hartehanks(dot)com wrote:
>
> on my server, I have 'http' registered as a user for my database. you can
> try that.
>
> Or you can add the user=username password=password to the pg_connect()
> function.
>
> Tim.
>
> Timothy P. Maguire
> Web Developer II
> Harte-Hanks
> 978 436 3325
>
>
>
>
> Jeff Self
> <jself(at)ci(dot)newport- To: timothy_maguire(at)hartehanks(dot)com
> news.va.us> cc: pgsql-php(at)postgresql(dot)org
> Subject: Re: Not able to connect to server from PHP
> 01/22/2002 04:18
> PM
>
>
>
>
>
>
> 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(at)hartehanks(dot)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
>
> HARTE- HANKS PRIVILEGED AND CONFIDENTIAL INFORMATION- if you are not the
> addressee or authorized to receive this for the addressee, you must not
> use, copy, disclose or take any action based on this message or any
> information herein and should delete this message.
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
--
Jeff Self
Information Technology Analyst
Department of Personnel
City of Newport News
2400 Washington Ave.
Newport News, VA 23607
757-926-6930

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Jean-Michel POURE 2002-01-23 13:58:21 Re: Long running queries and timeouts
Previous Message Andrew McMillan 2002-01-23 11:41:44 Re: "SQL" REPLACE SYNTAX