473,473 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can't connect to postgresql server

Can't connect to postgresql server

php error log message:

PHP Warning: pg_connect() [<a
href='function.pg-connect'>function.pg-connect</a>]: Unable to connect
to PostgreSQL server: could not connect to server: Permission
denied\n\tIs the server running on host &quot;127.0.0.1&quot; and
accepting\n\tTCP/IP connections on port 5432?

php connection string:

$conn_string = "hostaddr=127.0.0.1 port=5432 dbname=dbname
user=username password=password";

Also tried host=localhost

pg_hba:

host dbname username 127.0.0.1/32 md5

I can connect as that user with psql:

$ psql -h localhost -U username dbname
Password for user username:
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.

This same setup works in another server running 8.0. Differences:

old server | new server
FC3 | FC5
php 4.3.11 | php 5.1.4
httpd 2.0 | httpd 2.2
pgsql 8.0 | pgsql 8.1

I have another server (FC5 / 5.1.4 / 2.2 / 8.1) in which it works.

The same script running from another server (FC3 / 4.3.11/ 2.0) can
connect to the new
server using this pg_hba entry:
host dbname usename xx.xx.xxx.xx/32 md5

It just can't connect locally which is not postgres a problem since I
can connect locally with that user with psql.

What else should I check? I am out of ideas.

More details:
http://archives.postgresql.org/pgsql...7/msg00068.php

Regards, Clodoaldo Pinto

Jul 3 '06 #1
0 2731

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: D. Dante Lorenso | last post by:
I have a simple table that I'd like to query to pull out a heirarchy from a tree relationship. What is the best way to do this without a 'CONNECT BY' clause like Oracle has? Example mytable...
1
by: Rick Hickerson | last post by:
I can't get PHP to connect to DB2 on the same server. I'm running both Apache/PHP and DB2 on Mandrake Linux 9.2. I didn't compile PHP; just installed what appear to be the appropriate RPMs (I...
9
by: Greg Gursky | last post by:
Hello: I'm doing some planning on a potential project with which I need some help. The database at the focus of this question is a MS Access database that is currently accessed by DAO from a...
1
by: Carlos Ojea Castro | last post by:
Hello: In kylix3 I made a SQLConnection component (called 'SQLConnection1') to connect to a PostgreSQL database. I started the PostgreSQL server so Object inspector shows 'Connected: True' on...
0
by: vicky | last post by:
Hello Experts, Trying to run sample Postgrel's ECPG(Embedded SQL)programs on RHL 9.0. Im unable to connect to PostgreSQL database (sirishadb) when I run the program .... # su postgres...
4
by: newladder | last post by:
Hi all, Iam struck with one of the problem with postgres. Please help me out.... Iam trying to connect to connect to postgres database on remote machine with the IP address 10.2.1.4. Iam unable...
0
by: David Michael Schruth, | last post by:
Hi, I am sort of in a jam here. I am using the PsycoPG2 library to read data out of a windows XP based PostGIS / PostGreSQL database but I am apparently unable to write (update or insert) even...
3
by: irhernan | last post by:
Hi, I have just installed a postgresql server on a windows server. Now, I want to connect to it from a winodws desktop through http (intranet). What URL will I have to use to connect to the...
1
by: sasimca007 | last post by:
Hi friends, I installed mysql in ubuntu but, i don't know how to connect to that mysql. Actually we connect to postgresql by psql command, but when i tried to connect mysql with...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.