Bug #10325: Opening database connection breaks ldap
| From: | dan at fatal dot net | Date: | Sat, 14 Apr 2001 10:50:50 +0000 |
| Subject: | Bug #10325: Opening database connection breaks ldap | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-51566@lists.php.net to get a copy of this message | ||
From: dan@fatal.net
Operating system: Linux 2.4.3
PHP version: 4.0.4pl1
PHP Bug Type: LDAP related
Bug description: Opening database connection breaks ldap
Opening a database connection breaks LDAP's link index.
Example code:
<?php
$dbcon = pg_connect("host=localhost port=5432 dbname=testdb user=testuser
password=testpass");
$ds = ldap_connect("localhost");
$ldapcon = ldap_bind($ds);
// This always returns 1
echo $ldapcon;
// This errors out
ldap_search($ldapcon, "dc=test,dc=com", "cn=*");
?>
This generates the error:
PHP Warning: 1 is not a LDAP link index
If you comment out the pg_connect() line, LDAP works fine.
If you pg_close($dbcon) right after the pg_connect(), you still get the PHP error.
This is a definite show stopper considering some people use a database for sessions, which means you
can't use LDAP
after you start your session.
I'm using the latest openldap 2.0.7 & postgres 7.0.3,
php compiled into apache:
./configure --enable-memory-limit --enable-track-vars --enable-sysvsem --enable-sysvshm --with-gd
--with-pgsql --with-freetype --with-ldap=/usr/local/openldap --with-xml --with-mhash
--enable-trans-sid --with-kerberos --with-mcrypt --with-apache=../apache_1.3.19 --enable-bcmath
--with-zlib --with-sockets --enable-inline-optimizations
Please fix soon :)
--
Edit Bug report at: http://bugs.php.net/?id=10325&edit=1