Search Postgresql Archives

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

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

 



On Dec 23, 7:51 pm, adrian.kla...@xxxxxxxxx (Adrian Klaver) wrote:
> On Friday, December 23, 2011 1:32:49 am Shankar Palaniappan wrote:
>
> > 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.
>
> Some questions:
> 1) What is the connection string are you using for psql?

psql -p 5495 -d support_tool -U gls -h localhost

> 2) How are you connecting in each case(PHP,psql), remotely or locally?
I am connecting the psql from local and PHP from remote system. I was
also able to access the postgres from the same system using C program

> 3) What is listen_addresses set to in postgresql.conf?

I am running the postmaster with

postmaster -i -D /path

I am running with the following version and I dont have the privilege
to update the existing versions.  listen_addresses option is not
available in the existing version

postmaster (PostgreSQL) 7.4.2
PHP 5.2.6

Today I found one issue.. where I was not able to run the postmaster
with -h option ( that is not other than localhost)

The error what I got is that it was not able to create the listening
socket.

LOG:  could not bind IPv4 socket: Can't assign requested address
HINT:  Is another postmaster already running on port 5496? If not,
wait a few seconds and retry.
FATAL:  could not create listen socket for "IP address"

Please help me to resolve the issue. I dont have root privilege to
access the system

Thanks,
Shankar

>
>
>
>
>
>
>
> > <?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";
> > }
>
> > ?>
>
> --
> Adrian Klaver
> adrian.kla...@xxxxxxxxx
>
> --
> Sent via pgsql-general mailing list (pgsql-gene...@xxxxxxxxxxxxxx)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general- Hide quoted text -
>
> - Show quoted text -


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux