pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PHP and Postgres setup
3+ messages / 3 participants
[nested] [flat]

* PHP and Postgres setup
@ 2005-03-21 13:10  germ germ <super_code_monkey@yahoo.com>
  0 siblings, 2 replies; 3+ messages in thread

From: germ germ @ 2005-03-21 13:10 UTC (permalink / raw)
  To: pgsql-php

I have installed Postgres on Suse 9.1 and created a
test database but am unable to connect to it through
PHP.

What do I need to configure in order for Appache and
Postgres to be able to talk back and forth?


		
__________________________________ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PHP and Postgres setup
@ 2005-03-21 13:34  Matthew Terenzio <matt@jobsforge.com>
  parent: germ germ <super_code_monkey@yahoo.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Matthew Terenzio @ 2005-03-21 13:34 UTC (permalink / raw)
  To: pgsql-php


On Mar 21, 2005, at 8:10 AM, germ germ wrote:

>
> What do I need to configure in order for Appache and
> Postgres to be able to talk back and forth?

A couple things need to be done. It would help if you stated where and 
what the failure message was. If you haven't gotten that far then start 
with these items.

1. Check to see if you started postgres with a -i flag. this alows it 
to receive connections over the internet.
2.Also, in pg_hba.conf you must make sure you are allowing connections 
from the web server host. If that is the local host, you should be okay 
if you can already connect with the given user and pass you are going 
to use inside the PHP scripts. Restart postgres if you change this 
file. remember the -i again.
3. And you must have PHP compiled with postgres support.

You don't really need to change Apache. At least it's not necessary to 
start making connections to the DB.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PHP and Postgres setup
@ 2005-03-21 16:15  Michael Fuhr <mike@fuhr.org>
  parent: germ germ <super_code_monkey@yahoo.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Michael Fuhr @ 2005-03-21 16:15 UTC (permalink / raw)
  To: germ germ <super_code_monkey@yahoo.com>; +Cc: pgsql-php

On Mon, Mar 21, 2005 at 05:10:46AM -0800, germ germ wrote:

> I have installed Postgres on Suse 9.1 and created a
> test database but am unable to connect to it through
> PHP.

Please show the PHP code you're using to connect and any error
messages you get.  Without seeing what you're doing and what's
happening, guesses about what's wrong would have little basis.

> What do I need to configure in order for Appache and
> Postgres to be able to talk back and forth?

See the "Database Users and Privileges" and "Client Authentication"
chapters in the PostgreSQL documentation.  Verify that you can
connect to the database with psql before trying it with PHP.  Make
sure PHP has PostgreSQL support (you can check by examining phpinfo()
output).

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-03-21 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-21 13:10 PHP and Postgres setup germ germ <super_code_monkey@yahoo.com>
2005-03-21 13:34 ` Matthew Terenzio <matt@jobsforge.com>
2005-03-21 16:15 ` Michael Fuhr <mike@fuhr.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox