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

Re: Can't connect to 7.4 DB

From: Joshua Drake <jd(at)commandprompt(dot)com>
To: Michael Hanna <taojones(at)sympatico(dot)ca>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: Can't connect to 7.4 DB
Date: 2004-02-12 15:31:27
Message-ID: 402B9C4F.2070802@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-advocacypgsql-php
Hello,

What does the PostgreSQL log say? Is it even getting to the server? What 
abour the apache error log? Does it reflect an error?

Sincerely,

Joshua D. Drake


Michael Hanna wrote:
> Hi this php code:
> 
> 
>     
>     // add to DB
>     
>     // database access parameters
>     $host = "localhost";
>     $user = "postgres";
>     $pass = "postgres";
>     $db = "cosc3p94";
>     
>     // open a connection to the database server
>     $connection = pg_connect("host=$host dbname=$db user=$user 
> password=$pass");
>     
>     if (!$connection)
>     {
>             die("Could not open connection to database server");
>     }
>     
> 
>     ...
> 
> results in:
> 
> Could not open connection to database server
> 
> and I'm not sure why. The web browser, web server, and database are on 
> the same machine..
> 
> I checked the pg_hba.conf and it says this:
> 
> # TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
> 
> local   all         all                                             trust
> # IPv4-style local connections:
> host    all         all         127.0.0.1         255.255.255.255   trust
> # IPv6-style local connections:
> host    all         all         ::1               
> ffff:ffff:ffff:ffff:ffff:ffff:ff$
> 
> 
> which is untouched from the default settings...
> 
> Michael
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend


Attachment: jd.vcf
Description: text/x-vcard (347 bytes)

In response to

pgsql-advocacy by date

Next:From: Christopher BrowneDate: 2004-02-12 15:44:53
Subject: Re: I want to use postresql for this app, but...
Previous:From: scott.marloweDate: 2004-02-12 15:30:17
Subject: Re: Can't connect to 7.4 DB

pgsql-php by date

Next:From: Michael HannaDate: 2004-02-12 17:50:57
Subject: Re: Can't connect to 7.4 DB
Previous:From: scott.marloweDate: 2004-02-12 15:30:17
Subject: Re: Can't connect to 7.4 DB

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