# [SOLVED] phppgadmin: login failed

## jody

Hi 

I have installed apache2, php, and postgres.

My web application can log in to my postgres data base 

and read and manipulate data there.

But when i log in to phppgadmin with the exact same user 

and password as in my web application i always get 'login failed'

My  /var/www/localhost/htdocs/phppgadmin/conf/config.inc.php  is 'out of the box'

and i have 2 pg_hba.conf instances (both identical, and 'out of the box'):

```

-rw------- 1 postgres postgres 3652 Jun 13 20:32 /usr/local/pgsql/data/pg_hba.conf

-rw------- 1 postgres postgres 3652 Jun 12 19:10 /var/lib/postgresql/8.4/data/pg_hba.conf

```

Their content:

```
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only

local   all         all                               trust

# IPv4 local connections:

host    all         all         127.0.0.1/32          trust

# IPv6 local connections:

host    all         all         ::1/128               trust

```

Has anybody got a suggestion for me?

Thank You in advance

  JodyLast edited by jody on Fri Jun 25, 2010 1:52 pm; edited 1 time in total

----------

## PeGa!

Can you log in as the root postgres user? If not, watch for the config file -- phppgadmin doesn't allow root access for security reasons. Once solved that issue, log in as root, and verify the database permissions for that user in particular.

Regards,

Paul.

----------

## jody

Hi

I changed 'extra_login_secutirty' to false in /var/www/localhost/htdocs/phppgadmin/conf/config.inc.php 

```
      $conf['extra_login_security'] = false;
```

But even so my postgres user can't log in to phppgadmin.

Anway, i think the database permission are in order, because all my db-users

can log in through psql or in my php-script by means of 'pg_connect'

Jody

----------

## titanofold

Which connection method is phppgadmin utilizing? A Unix socket or localhost?

----------

## jody

Hi titanofold

 *Quote:*   

> Which connection method is phppgadmin utilizing? A Unix socket or localhost?

 

Would this be a setting in a configuration file? (if yes which one?)

Thank You

  Jody

----------

## titanofold

 *jody wrote:*   

> Hi titanofold
> 
>  *Quote:*   Which connection method is phppgadmin utilizing? A Unix socket or localhost? 
> 
> Would this be a setting in a configuration file? (if yes which one?)
> ...

 

Yes, in phppgadmin's config file. You told it where the server is located. (Something along the lines of 'host = . . . .')

If you didn't specify a host, then it'll use the Unix socket to communicate with the server . . . maybe.

You must have told phppgadmin where to find the server, so where did you tell it the server was located?

----------

## jody

hi

thanks for your reply.

I checked the config file ' config.inc.php' and changed the relevant entry from

```
    // Hostname or IP address for server.  Use '' for UNIX domain socket.

    // use 'localhost' for TCP/IP connection on this computer

    $conf['servers'][0]['host'] = '';

```

 to 

```
$conf['servers'][0]['host'] = 'localhost';
```

 and now i 

can log in to phppgadmin.

Thanks again

  Jody

----------

## titanofold

If you want to utilize the Unix domain socket, you'll have to add the apache system user to the postgres system group.

```
usermod -a -G postgres apache
```

As only users in the postgres system group can read/write from/to the socket.

----------

