473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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("host=localhost port=5432 dbname=hector
user=hector");
All help appreciated,
James
Jul 16 '05 #1
2 5461
James Ward wrote:
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("host=localhost port=5432 dbname=hector
user=hector");
All help appreciated,
James


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

Good luck,
Erwin
Jul 16 '05 #2
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:
ja*************@optushome.com.au wrote:
...
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.
...


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.


Jul 17 '05 #3

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

Similar topics

3
by: umagnum338 | last post by:
Hi, I'm having some troubles getting pg_connect() to connect over UNIX domain sockets. Something that really confuses me is the error string being served up by apache. It says it was unable to...
9
by: Paul Kuebler | last post by:
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...
1
by: NTPT | last post by:
Hi I try to upgrade postgresql 7.3.3 to 7.4.3 on my machine running Apache 2.0.49 and PHP 4.3.7 Because i use another path for postgres 7.4 there (luckily) stay a old libpg So while i...
1
by: Chifo | last post by:
I try to connect postgres database but browser showme a error"Fatal error undefined funtion pg_connect()" somebody can helpme ? i dont know whats means, all conection string its ok this is an...
2
by: John Oliver | last post by:
Fedora Core 2, httpd-2.0.54-10.2, php-4.3.10-2.4, postgresql-7.4.7-3.FC2.1 Using a test.php that includes: <?php pg_connect("host=localhost dbname=db_name user=user password=password$");...
6
diamond1
by: diamond1 | last post by:
Hi: How can solve this problem: Fatal error: Call to undefined function pg_connect() Thanks in advance
0
by: susikto | last post by:
hi, I am getting this error when I am trying to connect the PSQL database. PHP Warning: pg_connect() : Unable to connect to PostgreSQL server: FATAL: user &quot;apache&quot; does not exist Can...
6
by: mistral | last post by:
what is correct way open a PDF document in new window use hyperlink? I want show images thumbnails linked with PDF files, when click on thumbnail, PDF will be opened in new window. Some of PDF...
2
by: creative1 | last post by:
I get following error: Fatal error: Call to undefined function pg_connect() in C:\www\desiorb.dev\public_html\httpdocs\index.php on line 18 said line is to connect to postres pg_Connect.... ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.