php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25628 Cannot Connect to postgres database
Submitted: 2003-09-22 11:58 UTC Modified: 2003-09-29 05:56 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: matt at coffeecup dot com Assigned:
Status: No Feedback Package: PostgreSQL related
PHP Version: 4.3.4-dev OS: Red Hat Enterprise Linux ES 2.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: matt at coffeecup dot com
New email:
PHP Version: OS:

 

 [2003-09-22 11:58 UTC] matt at coffeecup dot com
Description:
------------
I upgraded to php 4.3.3, and started receiving this error when connecting to postgres:

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

I use the same configure line with php 4.3.2:

./configure --with-apxs=/usr/local/apache/bin/apxs --with-curl --with-xml --with-mysql=/usr --with-ssl --with-mcrypt
--enable-xslt-sablot --with-gd --with-jpeg-dir=/usr/bin/cjpeg --with-zlib --with-ttf --with-pgsql 

php.ini file remains the same:
; Maximum number of links (persistent+non persistent).  -1 means no limit.
pgsql.max_links = -1

When I re-install 4.3.2, the problem goes away.

Reproduce code:
---------------
$bd_db = pg_connect ("host=$hostname dbname=$database_name user=$username password=$password");

Expected result:
----------------
A connection to the database given

Actual result:
--------------
PHP Warning: pg_connect(): Cannot create new link. Too many open links (0).

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-22 14:59 UTC] matt at coffeecup dot com
This version had the exact same problem.
 [2003-09-22 19:06 UTC] iliaa@php.net
How many apache children do you have at maximum and how many connections (at maximum) does your postgreSQL allow to connect?
 [2003-09-29 05:56 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2006-08-09 22:38 UTC] mdchaney at michaelchaney dot com
I just had this same problem.  The problem stemmed from have 
two sets of "extension=" lines, first in /usr/local/etc/
php.ini, also in /usr/local/etc/php/extensions.ini.  Removing 
them from the php.ini file solved the problem.
 [2007-10-26 19:30 UTC] marcao_ramos at hotmail dot com
I'm using ubuntu 7.10 and I get this problem fixed when I take out the file 
pdo_pgsql.ini from /etc/php5/apache2/conf.d/ and put its content into 
/etc/php5/apache2/conf.d/pgsql.ini.

Only restart apache2 and that's all.
 [2009-03-24 11:38 UTC] sonikapant at gmail dot com
fdgdf
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 11:01:30 2024 UTC