Re: Can't connect to 7.4 DB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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

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@xxxxxxxxxxxxxxxxx
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


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux