Cannot connect to postgresql

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • charles.leviton@gmail.com

    Cannot connect to postgresql

    Hi all,
    I am running on Win XP. I have installed Apache 2.2. Works fine.
    I have installed php-4.4.4-Win32 manually.
    Apache to php connection is working fine, I tested a couple of trivial
    php scripts.

    I have installed PostGreSQL v8. I can do stuff (create table, populate
    data) thru pgAdminIII tool, so I think that is also fine.

    I want to install phpBB. When I try to do the set up I get message
    "The PHP configuration on your server doesn't support the database type
    that you chose"

    So it tells me the issue is with php and PGSQL, hence my question here.

    I have modified php.ini to uncomment the line
    extension=php_p gsql.dll
    and restarted the server. No good.

    I tried running this script that I copied from a site
    <html>
    <head>
    <title>PHP Test</title>
    </head>
    <body>
    <?php echo '<p>Hello World</p>'; ?>
    <?php $conn = pg_connect("hos t=localhost port=5432 dbname=postgres
    user=postgres password=mypass wd");
    $sql = "SELECT current_date AS today;";
    $result = pg_query($conn, $sql);
    $row = pg_fetch_object ($result, 0);
    echo "Today is: " .$row->today;
    ?>
    <?php phpinfo(); ?>
    </body>
    </html>


    It prints out the Hello World line. Doesn't print the phpinfo. Nor
    the current date.

    Needless to say, I know no php, just want to get the bulletin board up
    and running on my PC.

    Could anyone tell me
    a) If I still need some set-up? I see in many places that I should
    compile the php source with some options to enable postgreSQL. I
    really don't want to have to do this if I can avoid it
    b) Anything wrong with my postgre setup? I have started the postgresql
    as a service from the control panel.
    c) Anything wrong with the little script above?

    Thanks

  • Jerry Stuckle

    #2
    Re: Cannot connect to postgresql

    charles.leviton @gmail.com wrote:
    Hi all,
    I am running on Win XP. I have installed Apache 2.2. Works fine.
    I have installed php-4.4.4-Win32 manually.
    Apache to php connection is working fine, I tested a couple of trivial
    php scripts.
    >
    I have installed PostGreSQL v8. I can do stuff (create table, populate
    data) thru pgAdminIII tool, so I think that is also fine.
    >
    I want to install phpBB. When I try to do the set up I get message
    "The PHP configuration on your server doesn't support the database type
    that you chose"
    >
    So it tells me the issue is with php and PGSQL, hence my question here.
    >
    I have modified php.ini to uncomment the line
    extension=php_p gsql.dll
    and restarted the server. No good.
    >
    I tried running this script that I copied from a site
    <html>
    <head>
    <title>PHP Test</title>
    </head>
    <body>
    <?php echo '<p>Hello World</p>'; ?>
    <?php $conn = pg_connect("hos t=localhost port=5432 dbname=postgres
    user=postgres password=mypass wd");
    $sql = "SELECT current_date AS today;";
    $result = pg_query($conn, $sql);
    $row = pg_fetch_object ($result, 0);
    echo "Today is: " .$row->today;
    ?>
    <?php phpinfo(); ?>
    </body>
    </html>
    >
    >
    It prints out the Hello World line. Doesn't print the phpinfo. Nor
    the current date.
    >
    Needless to say, I know no php, just want to get the bulletin board up
    and running on my PC.
    >
    Could anyone tell me
    a) If I still need some set-up? I see in many places that I should
    compile the php source with some options to enable postgreSQL. I
    really don't want to have to do this if I can avoid it
    b) Anything wrong with my postgre setup? I have started the postgresql
    as a service from the control panel.
    c) Anything wrong with the little script above?
    >
    Thanks
    >
    Since your objective is to get phpBB running, did you ask in the phpBB
    support forum?


    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • charles.leviton@gmail.com

      #3
      Re: Cannot connect to postgresql

      Thanks. I was planning on doing that as well. But since my script to
      just connect to the database itself was not working I thought I might
      get any php problems out of the way before seeing if it was phpBB
      related.


      Jerry Stuckle wrote:
      charles.leviton @gmail.com wrote:
      Hi all,
      I am running on Win XP. I have installed Apache 2.2. Works fine.
      I have installed php-4.4.4-Win32 manually.
      Apache to php connection is working fine, I tested a couple of trivial
      php scripts.

      I have installed PostGreSQL v8. I can do stuff (create table, populate
      data) thru pgAdminIII tool, so I think that is also fine.

      I want to install phpBB. When I try to do the set up I get message
      "The PHP configuration on your server doesn't support the database type
      that you chose"

      So it tells me the issue is with php and PGSQL, hence my question here.

      I have modified php.ini to uncomment the line
      extension=php_p gsql.dll
      and restarted the server. No good.

      I tried running this script that I copied from a site
      <html>
      <head>
      <title>PHP Test</title>
      </head>
      <body>
      <?php echo '<p>Hello World</p>'; ?>
      <?php $conn = pg_connect("hos t=localhost port=5432 dbname=postgres
      user=postgres password=mypass wd");
      $sql = "SELECT current_date AS today;";
      $result = pg_query($conn, $sql);
      $row = pg_fetch_object ($result, 0);
      echo "Today is: " .$row->today;
      ?>
      <?php phpinfo(); ?>
      </body>
      </html>


      It prints out the Hello World line. Doesn't print the phpinfo. Nor
      the current date.

      Needless to say, I know no php, just want to get the bulletin board up
      and running on my PC.

      Could anyone tell me
      a) If I still need some set-up? I see in many places that I should
      compile the php source with some options to enable postgreSQL. I
      really don't want to have to do this if I can avoid it
      b) Anything wrong with my postgre setup? I have started the postgresql
      as a service from the control panel.
      c) Anything wrong with the little script above?

      Thanks
      >
      Since your objective is to get phpBB running, did you ask in the phpBB
      support forum?
      >
      >
      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • Jerry Stuckle

        #4
        Re: Cannot connect to postgresql

        charles.leviton @gmail.com wrote:
        Jerry Stuckle wrote:
        >
        >>charles.levit on@gmail.com wrote:
        >>
        >>>Hi all,
        >>>I am running on Win XP. I have installed Apache 2.2. Works fine.
        >>>I have installed php-4.4.4-Win32 manually.
        >>>Apache to php connection is working fine, I tested a couple of trivial
        >>>php scripts.
        >>>
        >>>I have installed PostGreSQL v8. I can do stuff (create table, populate
        >>>data) thru pgAdminIII tool, so I think that is also fine.
        >>>
        >>>I want to install phpBB. When I try to do the set up I get message
        >>>"The PHP configuration on your server doesn't support the database type
        >>>that you chose"
        >>>
        >>>So it tells me the issue is with php and PGSQL, hence my question here.
        >>>
        >>>I have modified php.ini to uncomment the line
        >>>extension=ph p_pgsql.dll
        >>>and restarted the server. No good.
        >>>
        >>>I tried running this script that I copied from a site
        >>><html>
        >><head>
        >> <title>PHP Test</title>
        >></head>
        >><body>
        >><?php echo '<p>Hello World</p>'; ?>
        >><?php $conn = pg_connect("hos t=localhost port=5432 dbname=postgres
        >>>user=postgre s password=mypass wd");
        >>$sql = "SELECT current_date AS today;";
        >>$result = pg_query($conn, $sql);
        >>$row = pg_fetch_object ($result, 0);
        >>echo "Today is: " .$row->today;
        >>>?>
        >><?php phpinfo(); ?>
        >></body>
        >>></html>
        >>>
        >>>
        >>>It prints out the Hello World line. Doesn't print the phpinfo. Nor
        >>>the current date.
        >>>
        >>>Needless to say, I know no php, just want to get the bulletin board up
        >>>and running on my PC.
        >>>
        >>>Could anyone tell me
        >>>a) If I still need some set-up? I see in many places that I should
        >>>compile the php source with some options to enable postgreSQL. I
        >>>really don't want to have to do this if I can avoid it
        >>>b) Anything wrong with my postgre setup? I have started the postgresql
        >>>as a service from the control panel.
        >>>c) Anything wrong with the little script above?
        >>>
        >>>Thanks
        >>>
        >>
        >>Since your objective is to get phpBB running, did you ask in the phpBB
        >>support forum?
        >>
        >>
        >>--
        >>============= =====
        >>Remove the "x" from my email address
        >>Jerry Stuckle
        >>JDS Computer Training Corp.
        >>jstucklex@att global.net
        >>============= =====
        >
        >
        Thanks. I was planning on doing that as well. But since my script to
        just connect to the database itself was not working I thought I might
        get any php problems out of the way before seeing if it was phpBB
        related.
        >
        >
        (Top posting fixed)

        Well, if it's a problem with the PHP code, we can help there. But it
        also requires a bit of php knowledge on your part. You need to do the
        initial troubleshooting ; we can't see your system.

        That's why I said - since your objective is to get a packaged program
        running, your best bet is to try the support structure for that package.
        It almost always is.

        P.S. Please don't top post.


        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • charles.leviton@gmail.com

          #5
          Re: Cannot connect to postgresql

          (Top posting fixed)
          >
          Well, if it's a problem with the PHP code, we can help there. But it
          also requires a bit of php knowledge on your part. You need to do the
          initial troubleshooting ; we can't see your system.
          >
          That's why I said - since your objective is to get a packaged program
          running, your best bet is to try the support structure for that package.
          It almost always is.
          Thanks. I think I get what you are saying. If my objective is getting
          phpBB up and running then the solution could even be to go w/ MySQL but
          essentially it is not a php challenge.
          OTOH, If my objective is to connect b/w php and PostGreSQL then I need
          to make more of a commitment to learning php.
          Valid point.

          Sorry about that top posting thing, I thought I'd cured myself of that
          ;-)

          Comment

          Working...