On Dec 22, 11:12 pm, pie...@xxxxxxxxxxxx (John R Pierce) wrote: > On 12/22/11 1:31 AM, Shankar Palaniappan wrote: > > > I am getting the following error when I try to connect from PHP with > > PostgreSQL server. > > Operating System is HP-UX and I was able to connect through PostgreSQL > > server from psql, > > what postgres connection parameters are you passing to the php > connection function? if you specified host=localhost, or some such, > then on psql use -h localhost to simulate this. > > -- > john r pierce N 37, W 122 > santa cruz ca mid-left coast > > -- > Sent via pgsql-general mailing list (pgsql-gene...@xxxxxxxxxxxxxx) > To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general Hi John, Thanks for your response. I am able to connect to the database through psql command. Please find the commands that I have tried through PHP and no success for past 3 days. Please let me know whether you can help me in this issue. <?php ini_set('track_errors','on'); // attempt a connection $dbh = pg_connect("host=/tmp/ dbname=test_tool port=5495 user=apache password=apache connect_timeout=20"); // $dbh = pg_connect("host=localhost port=5495 dbname=test_tool"); // $options = " host='localhost' port='5495' user='gls' password='' dbname='test_tool' "; // $dbh=pg_connect($options); if (!$dbh) { die("Error in connection: " . pg_last_error($dbh)); print_r($dbh); } else { echo "Connection is success"; } ?> -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general