From: Joshua Drake <jd@commandprompt.com>
To: Michael Hanna <taojones@sympatico.ca>
Cc: pgsql-php@postgresql.org
Subject: Re: Can't connect to 7.4 DB
Date: Thu, 12 Feb 2004 07:31:27 -0800
Message-ID: <402B9C4F.2070802@commandprompt.com> (raw)
In-Reply-To: <80431890-5D60-11D8-B81E-000A95B34330@sympatico.ca>
References: <C272C052-5CE0-11D8-B5E4-000A95EB456A@dotgeek.org>
<80431890-5D60-11D8-B81E-000A95B34330@sympatico.ca>
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
Attachments:jd.vcf (text/x-vcard, 345B) download
begin:vcard
fn:Joshua Drake
n:Drake;Joshua
org:Command Prompt, Inc.
adr:;;P.O. Box 215;Cascade Locks;OR;97014;US
email;internet:jd@commandprompt.com
title:Consultant
tel;work:503-667-4564
tel;fax:503-210-0334
note:Home of Mammoth PostgreSQL, and PostgreSQL Replicator.
x-mozilla-html:FALSE
url:http://www.commandprompt.com/
version:2.1
end:vcard
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: jd@commandprompt.com, taojones@sympatico.ca
Subject: Re: Can't connect to 7.4 DB
In-Reply-To: <402B9C4F.2070802@commandprompt.com>
References: <C272C052-5CE0-11D8-B5E4-000A95EB456A@dotgeek.org> <80431890-5D60-11D8-B81E-000A95B34330@sympatico.ca> <402B9C4F.2070802@commandprompt.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