[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: PHP+LDAP not really works [longer]



2003-01-11 Frode E. Moe:

> > real problem now, I'm using PHP 4.2.2 (RedHat 8.0) and the modify
> > function to LDAP works in 40% of the cases without any error or
> > warning,  works another 20% with warnings and doesn't work in the rest
> > of the cases either. I can't understand this situation. They could not
> > help me in the PHP list because my PHP code is perfect. :-) I think
> > there is some weird thing in the LDAP side. 
> 
> 
> I don't know your specific code or your specific errors, but we've been
> experiencing random segfaults and crashes when using APACHE+PHP+LDAP to
> access a windows Active Directory LDAP server.

I don't think my problem is so difficult. The ldap_modify function in
PHP returns with warning in some cases, then openldap 2.0.27 logs this:

--------------------

slapd[2915]: conn=-1 fd=22 closed 
slapd[2916]: conn=369 op=0 BIND dn="OU=USERS,O=ONLINE,C=HU" method=128 
slapd[2916]: conn=369 op=0 RESULT tag=97 err=0 text= 
slapd[4918]: conn=369 op=1 SRCH base="ou=Users, o=Online, c=HU" scope=2
filter="(uid=six)" 
slapd[4918]: conn=369 op=1 SEARCH RESULT tag=101 err=0 text= 
slapd[4917]: conn=369 op=2 BIND dn="UID=SIX,OU=USERS,O=ONLINE,C=HU"
method=128 
slapd[4917]: conn=369 op=2 RESULT tag=97 err=0 text= 
slapd[501]: daemon: conn=370 fd=22 connection from IP=127.0.0.1:33850
(IP=0.0.0.0:389) accepted. 
slapd[4919]: conn=370 op=0 BIND dn="UID=SIX,OU=USERS,O=ONLINE,C=HU"
method=128 
slapd[4919]: conn=370 op=0 RESULT tag=97 err=0 text= 
slapd[4905]: conn=370 op=1 MOD dn="uid=six, ou=Users, o=Online, c=HU" 
slapd[4924]: conn=370 op=2 UNBIND 
slapd[501]: daemon: conn=371 fd=46 connection from IP=127.0.0.1:33851
(IP=0.0.0.0:389) accepted. 
slapd[4904]: conn=371 op=0 BIND dn="" method=128 
slapd[4904]: conn=371 op=0 RESULT tag=97 err=0 text= 
slapd[4923]: conn=371 op=1 SRCH base="ou=Users, o=Online, c=HU" scope=2
filter="(uid=six)" 
slapd[4905]: conn=370 op=1 RESULT tag=103 err=0 text= 
slapd[4923]: conn=371 op=1 SEARCH RESULT tag=101 err=0 text= 
slapd[4905]: conn=-1 fd=22 closed 
slapd[4921]: conn=371 op=2 UNBIND 
slapd[4921]: conn=-1 fd=46 closed 
slapd[4906]: conn=369 op=3 UNBIND 
slapd[4906]: conn=-1 fd=45 closed 
slapd[501]: daemon: conn=372 fd=22 connection from IP=127.0.0.1:33852
(IP=0.0.0.0:389) accepted. 
slapd[982]: conn=372 op=0 BIND dn="OU=USERS,O=ONLINE,C=HU" method=128 
slapd[982]: conn=372 op=0 RESULT tag=97 err=0 text= 
slapd[980]: conn=372 op=1 SRCH base="ou=Users, o=Online, c=HU" scope=2
filter="(uid=six)" 
slapd[980]: conn=372 op=1 SEARCH RESULT tag=101 err=0 text= 
slapd[503]: conn=372 op=2 BIND dn="UID=SIX,OU=USERS,O=ONLINE,C=HU"
method=128 
slapd[503]: conn=372 op=2 RESULT tag=97 err=0 text= 
slapd[501]: daemon: conn=373 fd=45 connection from IP=127.0.0.1:33853
(IP=0.0.0.0:389) accepted. 
slapd[4922]: conn=372 op=3 UNBIND 
slapd[4922]: conn=-1 fd=22 closed 
slapd[4926]: conn=373 op=0 BIND dn="OU=USERS,O=ONLINE,C=HU" method=128 
slapd[4926]: conn=373 op=0 RESULT tag=97 err=0 text= 
slapd[504]: conn=373 op=1 SRCH base="ou=Users, o=Online, c=HU" scope=2
filter="(uid=six)" 
slapd[504]: conn=373 op=1 SEARCH RESULT tag=101 err=0 text= 
slapd[4916]: conn=373 op=2 BIND dn="UID=SIX,OU=USERS,O=ONLINE,C=HU"
method=128 
slapd[4916]: conn=373 op=2 RESULT tag=97 err=0 text= 
slapd[501]: daemon: conn=374 fd=22 connection from IP=127.0.0.1:33854
(IP=0.0.0.0:389) accepted. 
slapd[4925]: conn=374 op=0 BIND dn="" method=128 
slapd[4925]: conn=374 op=0 RESULT tag=97 err=0 text= 
slapd[4920]: conn=374 op=1 SRCH base="ou=Users, o=Online, c=HU" scope=2
filter="(uid=six)" 
slapd[4920]: conn=374 op=1 SEARCH RESULT tag=101 err=0 text= 
slapd[4339]: conn=374 op=2 UNBIND 
slapd[4339]: conn=-1 fd=22 closed 
slapd[501]: daemon: conn=375 fd=22 connection from IP=127.0.0.1:33855
(IP=0.0.0.0:389) accepted. 
slapd[4908]: conn=375 op=0 BIND dn="" method=128 
slapd[4908]: conn=375 op=0 RESULT tag=97 err=0 text= 
slapd[981]: conn=375 op=1 SRCH base="o=Online, c=HU" scope=2
filter="(uid=six)" 
slapd[981]: conn=375 op=1 SEARCH RESULT tag=101 err=0 text= 
slapd[502]: conn=375 op=2 SRCH base="ou=Groups,o=Online,c=HU" scope=1
filter="(&(objectClass=posixGroup)(|(memberUid=six)(uniqueMember=uid=six,ou=Users,o=Online,c=HU)))" 
slapd[502]: conn=375 op=2 SEARCH RESULT tag=101 err=0 text= 
slapd[501]: daemon: conn=376 fd=46 connection from IP=127.0.0.1:33856
(IP=0.0.0.0:389) accepted. 
slapd[2914]: conn=376 op=0 BIND dn="" method=128 
slapd[2914]: conn=376 op=0 RESULT tag=97 err=0 text= 
slapd[4340]: conn=376 op=1 SRCH base="o=Online, c=HU" scope=2
filter="(uid=six)" 
slapd[4340]: conn=376 op=1 SEARCH RESULT tag=101 err=0 text= 
slapd[4903]: conn=376 op=2 SRCH base="ou=Groups,o=Online,c=HU" scope=1
filter="(&(objectClass=posixGroup)(|(memberUid=six)(uniqueMember=uid=six,ou=Users,o=Online,c=HU)))" 
slapd[4903]: conn=376 op=2 SEARCH RESULT tag=101 err=0 text= 
slapd[501]: conn=-1 fd=46 closed 
slapd[501]: conn=-1 fd=22 closed 
slapd[2915]: conn=2 op=2064 SRCH base="o=Online,c=HU" scope=2
filter="(&(objectClass=posixAccount)(uid=\FC))" 
slapd[2915]: conn=2 op=2064 SEARCH RESULT tag=101 err=0 text= 
slapd[501]: daemon: conn=377 fd=22 connection from IP=127.0.0.1:33857
(IP=0.0.0.0:389) accepted. 
slapd[2916]: conn=377 op=0 BIND dn="" method=128 
slapd[2916]: conn=377 op=0 RESULT tag=97 err=0 text= 
slapd[4918]: conn=377 op=1 SRCH base="o=Online,c=HU" scope=2
filter="(&(|(host=*)(host=six.online.hu))(uid=root))" 
slapd[4918]: conn=377 op=1 SEARCH RESULT tag=101 err=0 text= 
slapd[501]: daemon: conn=378 fd=46 connection from IP=127.0.0.1:33858
(IP=0.0.0.0:389) accepted. 
slapd[4917]: conn=378 op=0 BIND dn="" method=128 
slapd[4917]: conn=378 op=0 RESULT tag=97 err=0 text= 
slapd[4919]: conn=378 op=1 SRCH base="o=Online, c=HU" scope=2
filter="(uid=root)" 
slapd[4919]: conn=378 op=1 SEARCH RESULT tag=101 err=0 text= 
slapd[4935]: conn=378 op=2 SRCH base="ou=Groups,o=Online,c=HU" scope=1
filter="(&(objectClass=posixGroup)(memberUid=root))" 
slapd[4935]: conn=378 op=2 SEARCH RESULT tag=101 err=0 text= 
slapd[501]: daemon: conn=379 fd=47 connection from IP=127.0.0.1:33859
(IP=0.0.0.0:389) accepted. 
slapd[4924]: conn=379 op=0 BIND dn="" method=128 
slapd[4924]: conn=379 op=0 RESULT tag=97 err=0 text= 
slapd[4904]: conn=379 op=1 SRCH base="o=Online, c=HU" scope=2
filter="(uid=root)" 
slapd[4904]: conn=379 op=1 SEARCH RESULT tag=101 err=0 text= 
slapd[4923]: conn=379 op=2 SRCH base="ou=Groups,o=Online,c=HU" scope=1
filter="(&(objectClass=posixGroup)(memberUid=root))" 
slapd[4923]: conn=379 op=2 SEARCH RESULT tag=101 err=0 text= 
slapd[4905]: conn=377 op=2 UNBIND 
slapd[4905]: conn=-1 fd=22 closed 
slapd[501]: conn=-1 fd=47 closed 
slapd[501]: daemon: conn=380 fd=22 connection from IP=127.0.0.1:33860
(IP=0.0.0.0:389) accepted. 
slapd[4921]: conn=380 op=0 BIND dn="" method=128 
slapd[4921]: conn=380 op=0 RESULT tag=97 err=0 text= 
slapd[4906]: conn=380 op=1 SRCH base="ou=Groups,o=Online,c=HU" scope=1
filter="(&(objectClass=posixGroup))" 
slapd[4906]: conn=380 op=1 SEARCH RESULT tag=101 err=0 text= 

--------------------

In other cases modifying finish w/o error. Then logfile looks like

--------------------

six slapd[501]: daemon: conn=363 fd=35 connection from
IP=127.0.0.1:33841 (IP=0.0.0.0:389) accepted. 
six slapd[4905]: conn=193 op=3 UNBIND 
six slapd[4905]: conn=-1 fd=33 closed 
six slapd[4904]: conn=363 op=0 BIND dn="OU=USERS,O=ONLINE,C=HU"
method=128 
six slapd[4904]: conn=363 op=0 RESULT tag=97 err=0 text= 
six slapd[4923]: conn=363 op=1 SRCH base="ou=Users, o=Online, c=HU"
scope=2 filter="(uid=six)" 
six slapd[4923]: conn=363 op=1 SEARCH RESULT tag=101 err=0 text= 
six slapd[4921]: conn=363 op=2 BIND dn="UID=SIX,OU=USERS,O=ONLINE,C=HU"
method=128 
six slapd[4921]: conn=363 op=2 RESULT tag=97 err=0 text= 
six slapd[501]: daemon: conn=364 fd=33 connection from
IP=127.0.0.1:33842 (IP=0.0.0.0:389) accepted. 
six slapd[4906]: conn=364 op=0 BIND dn="UID=SIX,OU=USERS,O=ONLINE,C=HU"
method=128 
six slapd[4906]: conn=364 op=0 RESULT tag=97 err=0 text= 
six slapd[4920]: conn=364 op=1 MOD dn="uid=six, ou=Users, o=Online,
c=HU" 
six slapd[501]: daemon: conn=365 fd=45 connection from
IP=127.0.0.1:33844 (IP=0.0.0.0:389) accepted. 
six slapd[982]: conn=198 op=3 UNBIND 
six slapd[982]: conn=-1 fd=47 closed 
six slapd[980]: conn=365 op=0 BIND dn="OU=USERS,O=ONLINE,C=HU"
method=128 
six slapd[980]: conn=365 op=0 RESULT tag=97 err=0 text= 
six slapd[4922]: conn=365 op=1 SRCH base="ou=Users, o=Online, c=HU"
scope=2 filter="(uid=six)" 
six slapd[503]: conn=364 op=2 UNBIND 
six slapd[4920]: conn=364 op=1 RESULT tag=103 err=0 text= 
six slapd[4922]: conn=365 op=1 SEARCH RESULT tag=101 err=0 text= 
six slapd[4926]: conn=365 op=2 BIND dn="UID=SIX,OU=USERS,O=ONLINE,C=HU"
method=128 
six slapd[4926]: conn=365 op=2 RESULT tag=97 err=0 text= 
six slapd[501]: daemon: conn=366 fd=46 connection from
IP=127.0.0.1:33845 (IP=0.0.0.0:389) accepted. 
six slapd[504]: conn=366 op=0 BIND dn="" method=128 
six slapd[504]: conn=366 op=0 RESULT tag=97 err=0 text= 
six slapd[4916]: conn=366 op=1 SRCH base="ou=Users, o=Online, c=HU"
scope=2 filter="(uid=six)" 
six slapd[4916]: conn=366 op=1 SEARCH RESULT tag=101 err=0 text= 
six slapd[4925]: conn=366 op=2 UNBIND 
six slapd[4925]: conn=-1 fd=46 closed 
six slapd[4920]: conn=-1 fd=33 closed 
six slapd[501]: daemon: conn=367 fd=33 connection from
IP=127.0.0.1:33846 (IP=0.0.0.0:389) accepted. 
six slapd[4339]: conn=365 op=3 UNBIND 
six slapd[4339]: conn=-1 fd=45 closed 
six slapd[4908]: conn=367 op=0 BIND dn="OU=USERS,O=ONLINE,C=HU"
method=128 
six slapd[4908]: conn=367 op=0 RESULT tag=97 err=0 text= 
six slapd[981]: conn=367 op=1 SRCH base="ou=Users, o=Online, c=HU"
scope=2 filter="(uid=six)" 
six slapd[981]: conn=367 op=1 SEARCH RESULT tag=101 err=0 text= 
six slapd[502]: conn=367 op=2 BIND dn="UID=SIX,OU=USERS,O=ONLINE,C=HU"
method=128 
six slapd[502]: conn=367 op=2 RESULT tag=97 err=0 text= 
six slapd[501]: daemon: conn=368 fd=45 connection from
IP=127.0.0.1:33847 (IP=0.0.0.0:389) accepted. 
six slapd[2914]: conn=368 op=0 BIND dn="" method=128 
six slapd[2914]: conn=368 op=0 RESULT tag=97 err=0 text= 
six slapd[4903]: conn=368 op=1 SRCH base="ou=Users, o=Online, c=HU"
scope=2 filter="(uid=six)" 
six slapd[4903]: conn=368 op=1 SEARCH RESULT tag=101 err=0 text= 
six slapd[4340]: conn=368 op=2 UNBIND 
six slapd[4340]: conn=-1 fd=45 closed 

--------------------

I can see differences but I can not decode it to human language...may
anybody help to understand it?
(Hint: This php page is in a password-protected webdirectory so extra
searches did by Apache. These logs didn't cut; in that case when it
works logfile is shorter but I dunno why.)

SiX