mod_perl/DBI,PHP4,Apache,pgsql problem

wxdqz

New Member
Hi:

We're running
- RedHat 6.1
- Apache 1.3.12
- Postgres 7.0.3
- PHP 4.0.2, mod_php installed as DSO
- mod_perl 1.24, installed static
- Apache::DBI 0.87
- DBI version 1.13
- DBD::Pg 0.93

Here's the problem:

If I preload the Apache::DBI module (for persistent DB connections in mod_perl handled code), any db connections from PHP, persistent or otherwise, don't close the connection properly, accumulate, and eventually throw "too many clients connected" errors, requiring a server restart (i.e. you can do netstat -a |grep PGSQL and watch the connections build up).

If I don't load Apache::DBI (which is a performance hit for other parts of the request phase that use the database) it works fine. We need the mod_perl stuff because many of our resources are not handled in the response phase by PHP, and we have global stuff that needs to be done during the access, auth, authz and log phases.

It looks to me like there are problems with the postgres libs, and the fact that both the mod_php and mod_perl modules are loading them into the runtime httpd when Apache::DBI is used, but I'm not sure.

Is there any way around this problem (that still allows persistent connections to be used in both mod_perl and mod_php), and has anyone had similar problems?

Thanks,

Michael Kahn
 
Back
Top