php -postgresql

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jay

    php -postgresql

    hi people,
    i have been trying to connect to the database using php. but i am not
    able to do so .i am getting the following errors




    *Warning*: pg_connect(): Unable to connect to PostgreSQL server:
    FATAL: IDENT authentication failed for user "jay" . in
    */var/www/proj/psql_results.ph p* on line *37*

    on using the following command
    $connection = pg_connect("hos t=localhost dbname=cs542 user=jay") or
    die("could not connect");

    can anyone tell me where am i going wrong.
    help would be greatly appreciated
    thanks
    jay


    ---------------------------(end of broadcast)---------------------------
    TIP 3: if posting/reading through Usenet, please send an appropriate
    subscribe-nomail command to majordomo@postg resql.org so that your
    message can get through to the mailing list cleanly

  • Chris

    #2
    Re: php -postgresql

    [color=blue]
    > *Warning*: pg_connect(): Unable to connect to PostgreSQL server:
    > FATAL: IDENT authentication failed for user "jay" . in
    > */var/www/proj/psql_results.ph p* on line *37*
    >
    > on using the following command
    > $connection = pg_connect("hos t=localhost dbname=cs542 user=jay") or
    > die("could not connect");[/color]

    check out $PGDATA/pg_hba.conf

    bye, chris


    ---------------------------(end of broadcast)---------------------------
    TIP 7: don't forget to increase your free space map settings

    Comment

    • Martin Marques

      #3
      Re: php -postgresql

      El Mié 28 Jul 2004 15:12, Jay escribió:[color=blue]
      > hi people,
      > i have been trying to connect to the database using php. but i am not
      > able to do so .i am getting the following errors
      >
      >
      >
      >
      > *Warning*: pg_connect(): Unable to connect to PostgreSQL server:
      > FATAL: IDENT authentication failed for user "jay" . in
      > */var/www/proj/psql_results.ph p* on line *37*[/color]

      The error message is quite obvious. You have an authentication problem.

      First, you are not sending the password, and it looks like you are using the
      ident method to autenticate, so jay should authenticate againt the ident
      server.

      You should take a good look at pg_hba.conf before you continue with the
      coding.

      --
      16:05:01 up 23 days, 7:42, 1 user, load average: 1.86, 0.97, 0.57
      -----------------------------------------------------------------
      Martín Marqués | select 'mmarques' || '@' || 'unl.edu.ar'
      Centro de Telematica | DBA, Programador, Administrador
      Universidad Nacional
      del Litoral
      -----------------------------------------------------------------

      ---------------------------(end of broadcast)---------------------------
      TIP 7: don't forget to increase your free space map settings

      Comment

      • Geoff Caplan

        #4
        Re: php -postgresql

        Jay,

        J> hi people,
        J> i have been trying to connect to the database using php. but i am not
        J> able to do so .i am getting the following errors

        You won't get in as user "Jay" on the default access settings. Unless
        you change the settings, Postgres expects to the system user to have
        the same username as the Postgres user. So the path of least
        resistance is to set up a Postgres user with the same name as Apache
        has on your system, and use that as the username in pg_connect().

        ------------------
        Geoff Caplan
        Vario Software Ltd
        (+44) 121-515 1154


        ---------------------------(end of broadcast)---------------------------
        TIP 6: Have you searched our list archives?



        Comment

        • Scott Marlowe

          #5
          Re: php -postgresql

          On Wed, 2004-07-28 at 14:08, Geoff Caplan wrote:[color=blue]
          > Jay,
          >
          > J> hi people,
          > J> i have been trying to connect to the database using php. but i am not
          > J> able to do so .i am getting the following errors
          >
          > You won't get in as user "Jay" on the default access settings. Unless
          > you change the settings, Postgres expects to the system user to have
          > the same username as the Postgres user. So the path of least
          > resistance is to set up a Postgres user with the same name as Apache
          > has on your system, and use that as the username in pg_connect().[/color]

          Actually, with ident turned on, you shouldn't need to have a user listed
          in pg_connect, or a password.


          ---------------------------(end of broadcast)---------------------------
          TIP 1: subscribe and unsubscribe commands go to majordomo@postg resql.org

          Comment

          Working...