[PHP-DEV] Bug #12372 Updated: LDAP calls within a function fail

2001-07-27 Thread Mike

ID: 12372
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Status: Feedback
Status: Open
Bug Type: LDAP related
Operating System: RedHat 7.0
PHP Version: 4.0.6


Previous Comments:


[2001-07-26 11:44:29] [EMAIL PROTECTED]

 OkLike 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] [EMAIL PROTECTED]

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?



[2001-07-25 15:14:55] [EMAIL PROTECTED]

 One other thingLdap calls seem to work when they are stand alone. Seems that with 
mysql_connect or mysql_pconnect the script goes to hell...

 



[2001-07-25 13:24:34] [EMAIL PROTECTED]

 When doing LDAP calls from within a function, it always returns 
'Warning: 1 is not a LDAP link index in blah.php on line 12'

 If I take the same code and put it in a .php file by itself it works great.

?

$ds=ldap_connect(blah.com) || die('Connection Failed');

if ($ds) {
$dn = ou=people, o=blah.com;
$r=ldap_bind($ds);
$justthese = array( ou, sn, givenname, mail, telephonenumber, mobile, 
title);
$filter = sn=*;

$sr=ldap_search($ds, $dn, $filter, $justthese);
$info = ldap_get_entries($ds, $sr);

for ($i=0; $i$info[count]; $i++) {
echo dn is: . $info[$i][dn] .br;
echo first name is: . $info[$i][givenname][0] .br;
echo lastname is: . $info[$i][sn][0] .br;
echo title is : . $info[$i][title][0] .br;
echo email is : . $info[$i][mail][0] .br;
echo telephone is : . $info[$i][telephonenumber][0] .p;
}

ldap_close($ds);
}

?

 I don't get the error at the ldap_connect line so it makes the connection. But when 
it gets to the ldap_bind it bombs out. 

 Here is my config line

./configure  --with-apache=../apache_1.3.20 --with-gd --with-pdflib=/usr/local 
--disable-debug --with-mnogosearch=/usr
/local/mnogosearch --with-mysql=/usr --with-zlib --enable-inline-optimization 
--with-gnu-ld --enable-memory-limit --enab
le-track-vars --with-jpeg-dir=/usr --with-tiff-dir=/usr --with-ttf=/usr 
--with-system-regex=yes --with-png-dir=/usr/lib 
--enable-trans-sid --enable-gd-imgstrttf --with-ldap=/usr/local/ldap

 Any help would be great.

 - Mike





Edit this bug report at http://bugs.php.net/?id=12372edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #12372 Updated: LDAP calls within a function fail

2001-07-27 Thread sniper

ID: 12372
Updated by: sniper
Reported By: [EMAIL PROTECTED]
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] [EMAIL PROTECTED]

Sorry my bad

it is not a parse errorI 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] [EMAIL PROTECTED]

 Ok this is too weirdMaybe 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] [EMAIL PROTECTED]

 OkLike 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] [EMAIL PROTECTED]

 OkLike 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] [EMAIL PROTECTED]

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=12372edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #12372 Updated: LDAP calls within a function fail

2001-07-26 Thread Mike

ID: 12372
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Feedback
Bug Type: LDAP related
Operating System: RedHat 7.0
PHP Version: 4.0.6
New Comment:

 OkLike 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



Previous Comments:


[2001-07-25 16:42:28] [EMAIL PROTECTED]

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?



[2001-07-25 15:14:55] [EMAIL PROTECTED]

 One other thingLdap calls seem to work when they are stand alone. Seems that with 
mysql_connect or mysql_pconnect the script goes to hell...

 



[2001-07-25 13:24:34] [EMAIL PROTECTED]

 When doing LDAP calls from within a function, it always returns 
'Warning: 1 is not a LDAP link index in blah.php on line 12'

 If I take the same code and put it in a .php file by itself it works great.

?

$ds=ldap_connect(blah.com) || die('Connection Failed');

if ($ds) {
$dn = ou=people, o=blah.com;
$r=ldap_bind($ds);
$justthese = array( ou, sn, givenname, mail, telephonenumber, mobile, 
title);
$filter = sn=*;

$sr=ldap_search($ds, $dn, $filter, $justthese);
$info = ldap_get_entries($ds, $sr);

for ($i=0; $i$info[count]; $i++) {
echo dn is: . $info[$i][dn] .br;
echo first name is: . $info[$i][givenname][0] .br;
echo lastname is: . $info[$i][sn][0] .br;
echo title is : . $info[$i][title][0] .br;
echo email is : . $info[$i][mail][0] .br;
echo telephone is : . $info[$i][telephonenumber][0] .p;
}

ldap_close($ds);
}

?

 I don't get the error at the ldap_connect line so it makes the connection. But when 
it gets to the ldap_bind it bombs out. 

 Here is my config line

./configure  --with-apache=../apache_1.3.20 --with-gd --with-pdflib=/usr/local 
--disable-debug --with-mnogosearch=/usr
/local/mnogosearch --with-mysql=/usr --with-zlib --enable-inline-optimization 
--with-gnu-ld --enable-memory-limit --enab
le-track-vars --with-jpeg-dir=/usr --with-tiff-dir=/usr --with-ttf=/usr 
--with-system-regex=yes --with-png-dir=/usr/lib 
--enable-trans-sid --enable-gd-imgstrttf --with-ldap=/usr/local/ldap

 Any help would be great.

 - Mike





Edit this bug report at http://bugs.php.net/?id=12372edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #12372 Updated: LDAP calls within a function fail

2001-07-26 Thread Mike

ID: 12372
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Feedback
Bug Type: LDAP related
Operating System: RedHat 7.0
PHP Version: 4.0.6
New Comment:

 OkLike 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



Previous Comments:


[2001-07-26 11:44:29] [EMAIL PROTECTED]

 OkLike 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] [EMAIL PROTECTED]

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?



[2001-07-25 15:14:55] [EMAIL PROTECTED]

 One other thingLdap calls seem to work when they are stand alone. Seems that with 
mysql_connect or mysql_pconnect the script goes to hell...

 



[2001-07-25 13:24:34] [EMAIL PROTECTED]

 When doing LDAP calls from within a function, it always returns 
'Warning: 1 is not a LDAP link index in blah.php on line 12'

 If I take the same code and put it in a .php file by itself it works great.

?

$ds=ldap_connect(blah.com) || die('Connection Failed');

if ($ds) {
$dn = ou=people, o=blah.com;
$r=ldap_bind($ds);
$justthese = array( ou, sn, givenname, mail, telephonenumber, mobile, 
title);
$filter = sn=*;

$sr=ldap_search($ds, $dn, $filter, $justthese);
$info = ldap_get_entries($ds, $sr);

for ($i=0; $i$info[count]; $i++) {
echo dn is: . $info[$i][dn] .br;
echo first name is: . $info[$i][givenname][0] .br;
echo lastname is: . $info[$i][sn][0] .br;
echo title is : . $info[$i][title][0] .br;
echo email is : . $info[$i][mail][0] .br;
echo telephone is : . $info[$i][telephonenumber][0] .p;
}

ldap_close($ds);
}

?

 I don't get the error at the ldap_connect line so it makes the connection. But when 
it gets to the ldap_bind it bombs out. 

 Here is my config line

./configure  --with-apache=../apache_1.3.20 --with-gd --with-pdflib=/usr/local 
--disable-debug --with-mnogosearch=/usr
/local/mnogosearch --with-mysql=/usr --with-zlib --enable-inline-optimization 
--with-gnu-ld --enable-memory-limit --enab
le-track-vars --with-jpeg-dir=/usr --with-tiff-dir=/usr --with-ttf=/usr 
--with-system-regex=yes --with-png-dir=/usr/lib 
--enable-trans-sid --enable-gd-imgstrttf --with-ldap=/usr/local/ldap

 Any help would be great.

 - Mike





Edit this bug report at http://bugs.php.net/?id=12372edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #12372 Updated: LDAP calls within a function fail

2001-07-25 Thread Mike

ID: 12372
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: LDAP related
Operating System: RedHat 7.0
PHP Version: 4.0.6
New Comment:

 One other thingLdap calls seem to work when they are stand alone. Seems that with 
mysql_connect or mysql_pconnect the script goes to hell...

 

Previous Comments:


[2001-07-25 13:24:34] [EMAIL PROTECTED]

 When doing LDAP calls from within a function, it always returns 
'Warning: 1 is not a LDAP link index in blah.php on line 12'

 If I take the same code and put it in a .php file by itself it works great.

?

$ds=ldap_connect(blah.com) || die('Connection Failed');

if ($ds) {
$dn = ou=people, o=blah.com;
$r=ldap_bind($ds);
$justthese = array( ou, sn, givenname, mail, telephonenumber, mobile, 
title);
$filter = sn=*;

$sr=ldap_search($ds, $dn, $filter, $justthese);
$info = ldap_get_entries($ds, $sr);

for ($i=0; $i$info[count]; $i++) {
echo dn is: . $info[$i][dn] .br;
echo first name is: . $info[$i][givenname][0] .br;
echo lastname is: . $info[$i][sn][0] .br;
echo title is : . $info[$i][title][0] .br;
echo email is : . $info[$i][mail][0] .br;
echo telephone is : . $info[$i][telephonenumber][0] .p;
}

ldap_close($ds);
}

?

 I don't get the error at the ldap_connect line so it makes the connection. But when 
it gets to the ldap_bind it bombs out. 

 Here is my config line

./configure  --with-apache=../apache_1.3.20 --with-gd --with-pdflib=/usr/local 
--disable-debug --with-mnogosearch=/usr
/local/mnogosearch --with-mysql=/usr --with-zlib --enable-inline-optimization 
--with-gnu-ld --enable-memory-limit --enab
le-track-vars --with-jpeg-dir=/usr --with-tiff-dir=/usr --with-ttf=/usr 
--with-system-regex=yes --with-png-dir=/usr/lib 
--enable-trans-sid --enable-gd-imgstrttf --with-ldap=/usr/local/ldap

 Any help would be great.

 - Mike





Edit this bug report at http://bugs.php.net/?id=12372edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #12372 Updated: LDAP calls within a function fail

2001-07-25 Thread venaas

ID: 12372
Updated by: venaas
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Feedback
Bug Type: LDAP related
Operating System: RedHat 7.0
PHP Version: 4.0.6
New Comment:

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?

Previous Comments:


[2001-07-25 15:14:55] [EMAIL PROTECTED]

 One other thingLdap calls seem to work when they are stand alone. Seems that with 
mysql_connect or mysql_pconnect the script goes to hell...

 



[2001-07-25 13:24:34] [EMAIL PROTECTED]

 When doing LDAP calls from within a function, it always returns 
'Warning: 1 is not a LDAP link index in blah.php on line 12'

 If I take the same code and put it in a .php file by itself it works great.

?

$ds=ldap_connect(blah.com) || die('Connection Failed');

if ($ds) {
$dn = ou=people, o=blah.com;
$r=ldap_bind($ds);
$justthese = array( ou, sn, givenname, mail, telephonenumber, mobile, 
title);
$filter = sn=*;

$sr=ldap_search($ds, $dn, $filter, $justthese);
$info = ldap_get_entries($ds, $sr);

for ($i=0; $i$info[count]; $i++) {
echo dn is: . $info[$i][dn] .br;
echo first name is: . $info[$i][givenname][0] .br;
echo lastname is: . $info[$i][sn][0] .br;
echo title is : . $info[$i][title][0] .br;
echo email is : . $info[$i][mail][0] .br;
echo telephone is : . $info[$i][telephonenumber][0] .p;
}

ldap_close($ds);
}

?

 I don't get the error at the ldap_connect line so it makes the connection. But when 
it gets to the ldap_bind it bombs out. 

 Here is my config line

./configure  --with-apache=../apache_1.3.20 --with-gd --with-pdflib=/usr/local 
--disable-debug --with-mnogosearch=/usr
/local/mnogosearch --with-mysql=/usr --with-zlib --enable-inline-optimization 
--with-gnu-ld --enable-memory-limit --enab
le-track-vars --with-jpeg-dir=/usr --with-tiff-dir=/usr --with-ttf=/usr 
--with-system-regex=yes --with-png-dir=/usr/lib 
--enable-trans-sid --enable-gd-imgstrttf --with-ldap=/usr/local/ldap

 Any help would be great.

 - Mike





Edit this bug report at http://bugs.php.net/?id=12372edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]