pg_connect(): ... Too many open links (0)

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

    pg_connect(): ... Too many open links (0)

    Hi all,
    I've searched high and low on the web and the group for the following error:

    pg_connect(): Cannot create new link. Too many open links (0)

    I have checked phpinfo and it says max_links is unlimited, and so is
    max_persistent.

    It's got to be something obvious - but I can't see it.

    How can I have too many links open if this is the first one!?!

    I'm running postgres 7.3.4 and php 4.3.3.

    I can access the database using pgAdmin - so I don't think it isn't a
    permissions problem. I've got tcp/ip access enabled.

    And for info the command I'm using is:

    $postgres = pg_connect("hos t=localhost port=5432 dbname=hector
    user=hector");


    All help appreciated,
    James
  • Erwin Moller

    #2
    Re: pg_connect(): ... Too many open links (0)

    James Ward wrote:
    [color=blue]
    > Hi all,
    > I've searched high and low on the web and the group for the following
    > error:
    >
    > pg_connect(): Cannot create new link. Too many open links (0)
    >
    > I have checked phpinfo and it says max_links is unlimited, and so is
    > max_persistent.
    >
    > It's got to be something obvious - but I can't see it.
    >
    > How can I have too many links open if this is the first one!?!
    >
    > I'm running postgres 7.3.4 and php 4.3.3.
    >
    > I can access the database using pgAdmin - so I don't think it isn't a
    > permissions problem. I've got tcp/ip access enabled.
    >
    > And for info the command I'm using is:
    >
    > $postgres = pg_connect("hos t=localhost port=5432 dbname=hector
    > user=hector");
    >
    >
    > All help appreciated,
    > James[/color]

    Look into the logfiles of postgres itself.
    They often have more information.

    Good luck,
    Erwin

    Comment

    • James Ward

      #3
      Re: pg_connect(): ... Too many open links (0)

      Thanks SO much. With your help I worked it out.

      I had installed the latest version of PHP with postgres support built-in.
      But in the previous version I had those sorts of extensions as shared
      extensions.
      Because none of the config files had changed it was still loading the OLD
      extensions.
      Once I deleted them it worked fine.

      Thanks a million,
      James

      ljb wrote:
      [color=blue]
      > jamesNOwardSPAM @optushome.com. au wrote:[color=green]
      >>...
      >> pg_connect(): Cannot create new link. Too many open links (0)
      >>
      >> I have checked phpinfo and it says max_links is unlimited, and so is
      >> max_persistent.
      >> ...[/color]
      >
      > I saw your post on the pg-php list and was curious. I cannot duplicate
      > this
      > at all, nor see how it is possible. The number in the "open links (0)"
      > message is num_links, the number of currently open links. The error
      > message is displayed if max_links != -1 and num_links >= max_links, where
      > max_links is -1 when phpinfo() reports "unlimited" . So I can't see how you
      > can get this message if phpinfo says max_links is unlimited.
      >
      > Some probably useless ideas: Check that ini_get("pgsql. max_links") really
      > does return -1 in that script before calling pg_connect. Don't set
      > max_links at all in php.ini. If you are loading pgsql.so as a shared
      > extension, make sure it matches the version in the PHP build. If you're
      > still stuck, post your platform details. Hopefully it's something really
      > weird.[/color]

      Comment

      Working...