PHP/postgreSQL - Mailing list pgsql-php

From vince@weaktight.com
Subject PHP/postgreSQL
Date
Msg-id 20060204171435.7lfphylyooggs08c@webmail.weaktight.com
Whole thread Raw
Responses Re: PHP/postgreSQL  ("Gavin M. Roy" <gmr@ehpg.net>)
Re: PHP/postgreSQL  (Frank Bax <fbax@sympatico.ca>)
List pgsql-php
I'm running PHP/mySQL via a web hosting service.  I require my PHP scripts to
access an external PostgreSQL database.

I have the PostgreSQL server setup to accept connections from anyone:
[pg_hba_conf]

# TYPE DATABASE USER CIDR-ADDRESS METHOD
host all all 0.0.0.0/0 trust

[--]

I've tested this connection via pgAdminIII and I'm able to connect using this
IP, but when I try to connect via php from the hosted webpage...

My php script is simple:

<?php
$conn_string = "host=24.85.82.xxx port=5432 dbname=PGSQL1 user=postgres
password=xxx";

$dbconn = pg_connect($conn_string);

if ($dbconn) {

print "Successfully connected to: " . pg_host($dbconn) . "<br/>\n";

} else {

print pg_last_error($dbconn);
exit;
}

pg_close($dbconn);
?>

But I'm foiled by:

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect
to server: Operation timed out Is the server running on host "24.85.82.xxx" and
accepting TCP/IP connections on port 5432? in
/usr/local/psa/home/vhosts/weaktight.com/httpdocs/mytest.php on line 13

Any thoughts or suggestions would be greatly appreciated. I'm not very
experienced with any of this stuff.

Thanks.


pgsql-php by date:

Previous
From:
Date:
Subject: Re: php and postgresql on windows
Next
From: "Gavin M. Roy"
Date:
Subject: Re: PHP/postgreSQL