Re: Unable to connect to PostgreSQL server : Could not get socket error status

Поиск
Список
Период
Сортировка
От Shankar Palaniappan
Тема Re: Unable to connect to PostgreSQL server : Could not get socket error status
Дата
Msg-id 854da474-ece1-4a04-b68a-493a1d71c9ba@v24g2000prn.googlegroups.com
обсуждение исходный текст
Ответ на Unable to connect to PostgreSQL server : Could not get socket error status  (Shankar Palaniappan <shankar.palaniappan@gmail.com>)
Ответы Re: Re: Unable to connect to PostgreSQL server : Could not get socket error status
Список pgsql-general
On Dec 22, 11:12 pm, pie...@hogranch.com (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...@postgresql.org)
> 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";
}

?>

В списке pgsql-general по дате отправления:

Предыдущее
От: Gavin Flower
Дата:
Сообщение: Re: PostgreSQL DBA in SPAAAAAAAACE
Следующее
От: Aman Gupta
Дата:
Сообщение: postgresql triggers - defining a global resource (java)