Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: PHP Warning...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 6 Topic 15508 of 17437
Post > Topic >>

Re: PHP Warning: pg_connect(): Unable to connect to

by ansarias@[EMAIL PROTECTED] (Abdus Samad Ansari) May 26, 2008 at 10:07 AM

The problem is solved, it was the Enhanced Security which was on and
creating problem in connecting with postgres thru cgi.


Thanks alot!


On Mon, 2008-05-12 at 17:55, Tino Wildenhain wrote:
> Hi,
> 
> Abdus Samad Ansari wrote:
> > PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server:
> > could not connect to server:
> > I have setup PHP/Postgres and is running fine upto do***ent root
> > i.e. /var/www/html, but when i am calling it through a cgi-bin php
file
> > it is giving log error as :
> > [error] [client 127.0.0.1] PHP Warning:  pg_connect(): Unable to
connect
> > to PostgreSQL server: could not connect to server: \x04\xe6\xe3\xbfPF;
> >
> well there are a couple of checks you could do to find out:
> 
> 1) decide how to connect - via IP or via unix socket
> 2) in each of the above see if postmaster is indeed listening to that
>     socket (netstat is your friend)
>     - adjust postgresql.conf and/or start options accordingly.
>     depending on your distribution you might want to enable logging
> 3) try connection via psql command line client
>     - see if you have matching pg_hba.conf entries
> 4) try to connect via psql command line client with the same user your
>     script runs (apache in your case)
>     - same as (3) but ident vs. md5 (password) in pg_hba.conf
> 
> after all you might want to use some pooling layer because pg_connect
> from cgi can get very expensive (also note that outside of PHP there
> are a lot possible elegant solutions to that)
> 
> Tino
-- 
----------------------------------------------------------------------
Abdus Samad Ansari
"Paribesh Bhawan" 10A, LA Block, 
Sec III, Salt Lake, Kolkata - 700 098
Phone :  91-033-2335 9829
----------------------------------------------------------------------


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




 6 Posts in Topic:
PHP Warning: pg_connect(): Unable to connect to PostgreSQL
ansarias@[EMAIL PROTECTED  2008-05-12 09:58:17 
Re: PHP Warning: pg_connect(): Unable to connect to PostgreSQL s
haraldarminmassa@[EMAIL P  2008-05-12 14:26:52 
Re: PHP Warning: pg_connect(): Unable to connect to PostgreSQL s
tgl@[EMAIL PROTECTED] (T  2008-05-12 10:44:41 
Re: PHP Warning: pg_connect(): Unable to connect to PostgreSQL s
aanderson@[EMAIL PROTECTE  2008-05-12 10:59:03 
Re: PHP Warning: pg_connect(): Unable to connect to PostgreSQL
dalroi@[EMAIL PROTECTED]   2008-05-13 08:10:56 
Re: PHP Warning: pg_connect(): Unable to connect to
ansarias@[EMAIL PROTECTED  2008-05-26 10:07:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 12:41:13 CST 2008.