Bug 113836 - php cannot open permanent connection to postgresql data base
php cannot open permanent connection to postgresql data base
Status: CLOSED DUPLICATE of bug 111545
Product: Fedora
Classification: Fedora
Component: php (Show other bugs)
1
i686 Linux
low Severity low
: ---
: ---
Assigned To: Joe Orton
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-19 06:01 EST by Edward Pilipczuk
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 14:00:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Edward Pilipczuk 2004-01-19 06:01:34 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031114

Description of problem:
php script contains:
...
if( !($dbconn = pg_pconnect( "host=localhost port=5432 dbname=mydb
user=me password=pass" )) ) {
    echo "Data Base OPEN Error, contact system administrator.<hr>";
    exit;
  };
...
This always produce output:

Warning: pg_pconnect(): Cannot create new link. Too many open links
(0). in /var/www/php/w3/auth.php on line 50
Data Base OPEN Error, contact system administrator.

Note, that user 'me' is defined in PostgreSQL database (CREATEDB
priviledge), database 'mydb' is created by 'me' using 'latin2'
encoding and database is accessible via 'psql -U me mydb' !



Version-Release number of selected component (if applicable):
php-4.3.4-1.1  php-pgsql-4.3.4-1.1 postgresql-7.3.4-11
postgresql-server-7.3.4-11

How reproducible:
Always

Steps to Reproduce:
1. $ createuser -d -U postgres me
2. $ createdb -U me mydb
3. Http GET of the page 
----
<?php
f( !($dbconn = pg_pconnect( "host=localhost port=5432 dbname=mydb
user=me password=pass" )) ) {
    echo "Data Base OPEN Error, contact system administrator.<hr>";
    exit;
  } else {
    echo "Connected.<hr>"
  };
?>


Actual Results:  The error is reported as in description:
---------
Warning: pg_pconnect(): Cannot create new link. Too many open links
(0). in xxx.php on line 3
----------

Expected Results:  FIX handling of permanent connections to Postgresql DB

Additional info:

The same scheme works properly on latest PHP and PostgreSQL update
releases of RH9
Comment 1 Edward Pilipczuk 2004-01-19 06:09:48 EST
additional info:
- pg_hba.conf contains the proper "trust" entries, that allows
unconditional local DB access 
- postmaster is running with '-i -p 5432' parameters
Comment 2 Joe Orton 2004-01-21 09:47:57 EST
Have you upgraded this system from RHL9? This may be a duplicate of 
bug 111545, where php.ini includes duplicate "extension=pgsql.so" lines.
Comment 3 Edward Pilipczuk 2004-01-21 11:20:42 EST
That's right!
I have used php.ini from the previous installation, 
where extensions are defined in php.ini,
while in current system all extensions are defined in php.d.
Now it works, thanks.

*** This bug has been marked as a duplicate of 111545 ***
Comment 4 Red Hat Bugzilla 2006-02-21 14:00:50 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

Note You need to log in before you can comment on or make changes to this bug.