Henry, Hi. That looks fine as far configuration goes, but what about explicitly connecting/disconnecting from LDAP? Are you issuing those requests anywhere? Maybe the bind function does that - I'm not familiar with it.
May be you could try replacing: $ldap->bind(); $results = $ldap->search ( $filter, null, Zend_Ldap::SEARCH_SCOPE_SUB, array(), 'sn'); With: $ldap->connect();$results = $ldap->search ( $filter, null, Zend_Ldap::SEARCH_SCOPE_SUB, array(), 'sn'); $ldapServer->disconnect(); This is how I do it in my implementation. Regards, Narinder. -- On 19/01/2012 22:44, "Henry Umansky" <[email protected]> wrote: >Hello Narinder, >This is the setREsource function: > >public function setResource() { > $options = Zend_Registry::get ( 'config' ); > $this->_resource = new Zend_Ldap ( $options->ldap ); > > if($this->_resource->getLastErrorCode()) > throw new >Exception($this->_resource->getLastErrorCode($this->_resource->getLastErro >r())); > > return $this; >} > >I tried putting a try/catch block, but for some reason my bind and search >wasn't throwing an exception. > >-Henry > >On Jan 19, 2012, at 11:07 AM, Narinder Chandi wrote: > >> Hi. Just a wild guess, but in my own LDAP implementation I explicitly >> issue connect/disconnect requests. Does your code do that? Maybe its >> wrapped up in some other code? FWIW, I'm not using the bind function >> either. I issue 1000s of search/add requests without problem. >> >> A fudged solution (hack!) would be to wrap your search call in try/catch >> to trap the Zend_Ldap_Exception that is raised and maybe try making the >> request 2 or 3 times? >> >> Regards, >> >> Narinder. >> -- >> >> >> >> On 19/01/2012 15:54, "Henry Umansky" <[email protected]> wrote: >> >>> Hello all, >>> Not sure how to troubleshoot this problem, perhaps you can offer me >>>some >>> assistance. I have a page that does a simple LDAP lookup using >>>Zend_Ldap >>> and ZF v1.9.1. When I have restart the server, initially it works, but >>> after about 30 minutes or so, it starts failing about 1 in every 3-5 >>> requests. Nothing in the error log and the exception just says: >>> >>> Message: LDAP error: 0x51 (Can't contact LDAP server): >>> ldaps://ldap.sample.com:636 >>> >>> The LDAP is a stable, busy service with no other applications having >>> problems, only my ZF application. Any thoughts on how I can >>>troubleshoot >>> this issue? Here is my code: >>> >>> public function search() { >>> $ldap = $this->getResource(); >>> $filter = $this->getFilter(); >>> >>> $ldap->bind(); >>> $results = $ldap->search ( $filter, null, Zend_Ldap::SEARCH_SCOPE_SUB, >>> array(), 'sn'); >>> >>> return $results; >>> } >>> >>> Any thoughts or recommendations? >>> >>> Thank you, >>> Henry >> >> >> >> -- >> List: [email protected] >> Info: http://framework.zend.com/archives >> Unsubscribe: [email protected] >> >> > > >-- >List: [email protected] >Info: http://framework.zend.com/archives >Unsubscribe: [email protected] > > -- List: [email protected] Info: http://framework.zend.com/archives Unsubscribe: [email protected]
