Re: Function pg_pconnect do not work in FreeBSD

From: Marco Colombo <marco(at)esi(dot)it>
To: re ert <matlab21(at)yahoo(dot)es>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: Function pg_pconnect do not work in FreeBSD
Date: 2001-12-18 19:23:02
Message-ID: Pine.LNX.4.33.0112182011240.1226-100000@Megathlon.ESI
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On Thu, 13 Dec 2001, [iso-8859-1] re ert wrote:

> From: matlab21(at)yahoo(dot)es
> Operating system: FreeBSD
> PHP version: 4.0.6 (and 4.1)
> Bug description: function pg_pconnect do not work in
> FreeBSD
> Operative System: FreeBSD
>
> Hello everybody.
>
>

[...]
> In this moment apache works, PHP works. I can see the
> simple script <?php phpinfo(); ?> with no problems.
> But I can not connect to PostgreSQL database ( tried
> connect and pg_pconnect functions). After a while
> apperas this message:

Please, post the parameters you pass to pg_pconnect(). "after a while"
means that there's seems to be a kind of (network) timeout, I guess?

> Warning: Unable to connect to PostgreSQL server:
> connectDBStart() --
> connect() failed: No route to host Is the postmaster
> running (with -i)
> at
> 'localhost' and accepting connections on TCP/IP port
> 5432? in /usr/home/pfc/phplib/php/db_pgsql.inc on line
> 47
> Database error: Link-ID == false, pconnect failed
> PostgreSQL Error: 0 ()
> Session halted.
>
> I can sure you that postgres is running and I iniciate
> postmaster with the '-i' flag. In the file
> /usr/local/pgsql/data/pg_dba.conf I have the
> following:
>
> local all trust
> host all 127.0.0.1 255.255.255.0 trust
> host all 192.168.99.1 255.255.255.0 trust
>
> NOTE: 192.168.99.1 is the server's IP.

Does psql work?

$ PGUSER=<user> psql -h localhost <database>

where <user> is the user you're passing to pg_pconnect(), or the user
the apache daemon runs with. <database> is of course the database
you're tring to [p]connect to.

Also try:

$ PGUSER=<user> psql -h 192.168.99.1 <database>

Both should work. If not, your problem is either with the postgres
server or the networking of the system (it may even caused by IP filter
rules - or by a misconfigured resolver).

> I can sure I have installed apache-php-postgres in
> linux and SunOS with the same method and here work
> well. I do not know why PHP can not comunicate
> with PostgreSQL using FreeBSD.
>
> I also try to install from ports, but I have the same
> problem.
>
> Thanks a lot for.
>
> I am pleased if anyone could solvent this problem.
> If there is anyone who want contact me (for telling
> more details, ... )
> No doubt write to: matlab21(at)yahoo(dot)es
>
> Xevi Serrats.
>
> NOTE: excuse me, english isn't my native language.

.TM.
--
____/ ____/ /
/ / / Marco Colombo
___/ ___ / / Technical Manager
/ / / ESI s.r.l.
_____/ _____/ _/ Colombo(at)ESI(dot)it

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Gurudutt 2001-12-19 09:28:51 Maximum Execution Timeout Error!!
Previous Message Christopher Kings-Lynne 2001-12-18 01:39:43 Re: Determing Postgres version