473,396 Members | 1,590 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(): Cannot create new link. Too many open links (0)

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();
?>

I get PHP Warning: pg_connect(): Cannot create new link. Too many open
links (0) in /home/www/mywebsite.com/html/index.php on line 2

I did have a line extension=pgsql.so in /etc/php.ini but have removed
it. I do have /etc/php.d/pgsql.ini that contains the same line. That's
the solution that all responses I've found have suggested. What else
can I try?

--
* John Oliver http://www.john-oliver.net/ *
* Reform California gun laws - http://www.reformcagunlaws.com/ *
* http://www.gunownersca.com - http://www.crpa.org/ *
* San Diego shooters come to http://shooting.forsandiego.com/ *
Apr 24 '06 #1
2 2371
On Tue, 25 Apr 2006 01:14:01 GMT, ljb wrote:
jo*****@john-oliver.net wrote:
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();
?>

I get PHP Warning: pg_connect(): Cannot create new link. Too many open
links (0) in /home/www/mywebsite.com/html/index.php on line 2

I did have a line extension=pgsql.so in /etc/php.ini but have removed
it. I do have /etc/php.d/pgsql.ini that contains the same line. That's
the solution that all responses I've found have suggested. What else
can I try?
This sounded familiar... I found a thread from 2003 where somebody had the
same error. I assume you checked phpinfo() output and made sure
pgsql.max_links isn't set too low, and that your script isn't caught
in a loop allocating new connections. I told that person:


FWIW, it turned out that I needed to restart httpd. I'd been restarting
PostGreSQL.
So I think you are on the right track. I don't know what
/etc/php.d/pgsql.ini does... it isn't standard with either PHP or
PostgreSQL. But make sure you are using only one PHP PostgreSQL extension
(built-in, or dynamically loaded), and if dynamically loaded make sure it
was built for your version of PHP.


That's a Red hat-ism. AAMOF, it turned out that I was calling the MySQL
module twice, and even though it still worked it was logging tons and
tons of errors about duplicates. So I fixed two problems, one I hadn't
realized that I had :-)

--
* John Oliver http://www.john-oliver.net/ *
* Reform California gun laws - http://www.reformcagunlaws.com/ *
* http://www.gunownersca.com - http://www.crpa.org/ *
* San Diego shooters come to http://shooting.forsandiego.com/ *
Apr 25 '06 #2
> * Reform California gun laws - http://www.reformcagunlaws.com/ *
* http://www.gunownersca.com - http://www.crpa.org/ *
* San Diego shooters come to http://shooting.forsandiego.com/ *
If you want to announce your politics, that's fine. I shall do the
same. Guns are evil, and kill lots of people. In the UK we have an
unarmed police force and for that I am grateful. This is not a pro-gun
group. It is not an anti-gun group. Politics has no place here.

Now, your problem.
I did have a line extension=pgsql.so in /etc/php.ini but have removed
it. I do have /etc/php.d/pgsql.ini that contains the same line. That's
the solution that all responses I've found have suggested. What else
can I try?


Do a phpinfo() to see which config file you are using.
"extension=pgsql.so " will need to be in that file. Then come back to
us.

Apr 25 '06 #3

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

Similar topics

2
by: James Ward | last post by:
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...
5
by: Sally B. | last post by:
Hello, I searched, but couldn't find answers--probably because I'm not sure what this is called... Anyway, I have about 50 web pages and I want to have some JavaScript that will read in a list of...
0
by: Juan Jose Costello Levien | last post by:
Hello, My name is Juan. I am new to the forum. Here I leave you a problem to see if you can help me. General Description I am developing an application in Visual Basic 6.
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
3
by: debbie | last post by:
I have an Access 2002 program that I install using Wise. The first thing my program does when a front end is opened is re-link, then it checks the version and if needed upgrades the backend. My...
9
by: Jeff | last post by:
This a little strange. The link in a FE database get corrupted when the BE get compacted, and the FE is not even open. I have checked. The data is fine in the BE. The data is fine in the link...
3
by: gmax2006 | last post by:
Hi, I am using RedHat Linux 4. and I developed an oracle 10g based application by using cx_Oracle (cx_Oracle-4.1-10g-py23-1.i386.rpm) and Python 2.3.4. When I run the application through...
1
by: bn4 | last post by:
I have been trying to modify a script that i had working in the past but have lost.. ORIGINAL URL: http://www.thescripts.com/forum/thread147097.html STEPS: I want it to do the following:...
3
by: Hazza | last post by:
Hi, I am using PHP and mysql to create a website. I am fairly new to PHP, and thus am grateful to anyone who helps! Firstly I am running a homepage, that displays additional content if a user...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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.