473,779 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 16 '05 #1
2 5484
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("hos t=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
1777
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 connect to database xxxx. However, the characters are gibberrish. At first I thought that my problem was that I forgot to give the user name also (seeing there was no apache user in postgresql). However that wasn't it. To make sure though, I...
9
1882
by: Paul Kuebler | last post by:
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...
1
1553
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 compile php with --with-pgsql=shared an old, 7.3.3 libpg is used by PHP. Everything fine, run and works.
1
2788
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 example: $conn=pg_connect("host=142.1240.123.10 port=3452 dbname=datbase user=mi password=pwd") thanks, regards
2
2399
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$"); phpinfo(); ?>
6
51580
diamond1
by: diamond1 | last post by:
Hi: How can solve this problem: Fatal error: Call to undefined function pg_connect() Thanks in advance
0
1750
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 anyone tell me what the problem is? Regards susikta
6
18227
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 files are in the same web server, other are in a remote location. Any help will be appreciated.
2
26378
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.... I also want to tell that: I am setting up virtual host on my computer, apache works for projects that don't have database support. I uncomment php.ini file for postgres. Apache runs fine there is no error.
0
9633
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10305
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10137
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9928
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7483
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.