Bug #12372 Updated: LDAP calls within a function fail

From: Date: Fri, 27 Jul 2001 17:59:02 +0000
Subject: Bug #12372 Updated: LDAP calls within a function fail
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-61269@lists.php.net to get a copy of this message
ID: 12372 Updated by: sniper Reported By: Mike@ftl.com Old Status: Open Status: Bogus Bug Type: LDAP related Operating System: RedHat 7.0 PHP Version: 4.0.6 New Comment: $ds=ldap_connect("ldap.blah.com") || die('Connection Failed'); ^^ This is the problem.. Answer is here:http://www.php.net/manual/en/language.operators.precedence.php (hint: Change the '||' to 'or' :) --Jani Previous Comments: ------------------------------------------------------------------------ [2001-07-27 13:47:50] Mike@ftl.com Sorry my bad.... it is not a parse error....I typed FAT FINGERED when I typed in here... Should read $ds=ldap_connect("ldap.blah.com") || die('Connection Failed'); ^^^^ cut an pasted from script. with domain changed of course Sorry bout that. - Mike ------------------------------------------------------------------------ [2001-07-27 13:36:40] Mike@ftl.com Ok this is too weird....Maybe you developers can make sense of this... My ldap connect line looked like this... $ds = ldap_connect("ldap.blah.com") || die{'failed connect'); If I drop the "|| die('failed connect')" , the scripts work great. ------------------------------------------------------------------------ [2001-07-26 11:51:21] Mike@ftl.com Ok....Like I said, it seems that it only bombs when you are doing mysql calls in the same script. Take the code below, or your own simple ldap search and add this to your script. - Snip - $connect = mysql_connect("db-server","user","password"); mysql_close($connect); - Snip - Ya I know it's not doing anything but opening and closing the connection. If ya want, add a little query in there. It still acts the same. I have tried this with openldap and ldapcsdk50 and both give the same results. Running MySQL-3.23.40(Tried with 3.23.37 as well). Let me know what other info you may need. Thanks, -Mike ------------------------------------------------------------------------ [2001-07-26 11:44:29] Mike@ftl.com Ok....Like I said, it seems that it only bombs when you are doing mysql calls in the same script. Take the code below, or your own simple ldap search and add this to your script. - Snip - $connect = mysql_connect("db-server","user","password"); mysql_close($connect); - Snip - Ya I know it's not doing anything but opening and closing the connection. If ya want, add a little query in there. It still acts the same. I have tried this with openldap and ldapcsdk50 and both give the same results. Running MySQL-3.23.40(Tried with 3.23.37 as well). Let me know what other info you may need. Thanks, -Mike ------------------------------------------------------------------------ [2001-07-25 16:42:28] venaas@php.net Are you sure the problem isn't simply that you do $ds = ldap_connet.... outside the function, and are not passing $ds as parameter to it? I'm not able to reproduce this, could you perhaps give an example script that fails? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/?id=12372 Edit this bug report at http://bugs.php.net/?id=12372&edit=1

« previous php.dev (#61269) next »