Skip site navigation (1) Skip section navigation (2)

Re: Freebsd/Postgres/Apache+PHP

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: babak badaei <badaei(at)yahoo(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Freebsd/Postgres/Apache+PHP
Date: 2011-03-31 20:57:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
On 03/31/2011 12:18 PM, babak badaei wrote:
> Hello Postgres Community,
> Thank you guys very much for PostgreSQL. To me, its the best database management system under the sun. I am setting up a new jail configuration on FreeBSD with sockets and everything enabled. I can ping localhost fine. The problem is that when I load a script that connects to the database, Postgres says Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "x.x.x.x" (my actual web IP). I have done the following on the host machine:
> I'd like Apache/PHP to just connect to Postgres localhost, not via the jail's IP--thus, no change to pg_hba.conf is needed. 
> If you guys have any suggestions it would be very much appreciated!
I have no experience actually using a modern FreeBSD jail, but I do have 
some questions?

1. Are PHP and PostgreSQL running in different jails?

2. What are the addresses PostgreSQL is set to listen on?

3. What PHP statement are you using to establish the connection?

4. If PHP and PostgreSQL are on different jails,

1. Be sure you are connecting with localhost, not local unix domain 
sockets (it appears you are based on the error message).

2. Is PHP running on a different jail than PHP? If my reading is 
correct, a FreeBSD jail is basically a virtual host and has its own IP 
addresses and I doubt that the loopback localnet is shared among those 

3. What is the IP address of the server and of the client and what PHP 
connection statement are you using?


In response to

pgsql-admin by date

Next:From: Rangi, JaiDate: 2011-03-31 23:16:30
Subject: PG 9.0 Replcation
Previous:From: dx k9Date: 2011-03-31 20:04:09
Subject: shared_preload_libraries

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group