X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id AA5CCD1D18D for ; Thu, 12 Feb 2004 15:30:04 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 48393-09 for ; Thu, 12 Feb 2004 11:30:01 -0400 (AST) Received: from hosting.commandprompt.com (215.commandprompt.com [207.173.200.215]) by svr1.postgresql.org (Postfix) with ESMTP id A1F85D1D3A4 for ; Thu, 12 Feb 2004 11:29:56 -0400 (AST) Received: from commandprompt.com (clbb-248.saw.net [64.146.135.248]) (authenticated) by hosting.commandprompt.com (8.11.6/8.11.6) with ESMTP id i1CFTwL29819; Thu, 12 Feb 2004 07:29:59 -0800 Message-ID: <402B9C4F.2070802@commandprompt.com> Date: Thu, 12 Feb 2004 07:31:27 -0800 From: Joshua Drake Organization: Command Prompt, Inc. User-Agent: Mozilla Thunderbird 0.5b (X11/20040202) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Hanna Cc: pgsql-php@postgresql.org Subject: Re: Can't connect to 7.4 DB References: <80431890-5D60-11D8-B81E-000A95B34330@sympatico.ca> In-Reply-To: <80431890-5D60-11D8-B81E-000A95B34330@sympatico.ca> Content-Type: multipart/mixed; boundary="------------080803030101030905070904" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/27 X-Sequence-Number: 2575 This is a multi-part message in MIME format. --------------080803030101030905070904 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 --------------080803030101030905070904 Content-Type: text/x-vcard; charset=utf8; name="jd.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="jd.vcf" 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 --------------080803030101030905070904--