From: johnny at skydiveflorida dot net
Operating system: Debian linux
PHP version: 4.3.4
PHP Bug Type: PostgreSQL related
Bug description: pg_pconnect(): Cannot create new link. Too many open links (0)
Description:
------------
When I make a call to pg_pconnect(), I get the error:
Warning: pg_pconnect(): Cannot create new link. Too many open links (0).
My system configuration:
seven:/etc/php4/apache# dpkg -l | grep php4
ii php4 4.3.4-4 A server-side, HTML-embedded scripting
langu
ii php4-curl 4.3.4-4 CURL module for php4
ii php4-gd2 4.3.2+rc3-2 GD module (with GD2) for php4
ii php4-mysql 4.3.4-4 MySQL module for php4
ii php4-pear 4.1.2-6woody3 PEAR - PHP Extension and Application
Reposit
ii php4-pgsql 4.3.3-2 PostgreSQL module for php4
ii php4-xslt 4.3.4-4 XSLT module for php4
seven:/etc/php4/apache# dpkg -l | grep postgres
ii postgresql 7.4.2-0.backpo Object-relational SQL database,
descended fr
ii postgresql-cli 7.4.2-0.backpo Front-end programs for PostgreSQL
ii postgresql-doc 7.2.1-2woody4 Documentation for the PostgreSQL
database.
PHPInfo() for pgsql:
pgsql
PostgreSQL Support enabled
PostgreSQL(libpq) Version 7.4.2
Multibyte character support enabled
SSL support enabled
Active Persistent Links 0
Active Links 0
Directive Local Value Master Value
pgsql.allow_persistent On On
pgsql.auto_reset_persistent Off Off
pgsql.ignore_notice Off Off
pgsql.log_notice Off Off
pgsql.max_links 150 150
pgsql.max_persistent 100 100
Note that .max_links and .max_persistent were originally set to unlimited
in php.ini (ie -1) but I tried changing the values to determine if the
outcome would be different.
I realise that bug reports for previous versions (6+ months ago) have been
submitted and answered, but I've read them and they do not solve the
issue, they just suggest using the latest stable version of php4
Reproduce code:
---------------
function connect()
{
$this->dsn = "host='" . $this->hostName . "' port='" . $this->port
. "' dbname='" . $this->database . "' user='" . $this->userName . "'
password='". $this->passwd . "'";
$this->link = pg_pconnect($this->dsn);
...
return $this->link;
}
This code was tested and working using previous version of php4 /
php4-pgsql packages as described above.
The line that causes the error is
$this->link = pg_pconnect(...);
Expected result:
----------------
expect connection to be made to the postgres database.
Actual result:
--------------
Actual result is a warning, not a crash.
--
Edit bug report at http://bugs.php.net/?id=28159&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28159&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28159&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28159&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28159&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28159&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28159&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28159&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28159&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28159&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28159&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28159&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28159&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28159&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28159&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28159&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28159&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28159&r=float