0x7002: LDAP extension not loaded in ZF2

This is my Action

public function loginAction()
{
    $request= $this->getRequest();
    if($request->isPost())
    {
        $username= $request->getPost('email');
        $password= $request->getPost('password');

        $auth = new AuthenticationService();
        $adapter = new AuthAdapter(
            array('server1'=>array(
                'host' => '192.168.1.4',
                'useStartTls' => false,
                'useSsl' => false,
                'accountDomainName' => 'coasting',
                'accountDomainNameShort' => 'DOMAIN',
                'accountCanonicalForm' => 3,
                'accountFilterFormat' => '(&(objectClass=user)(sAMAccountName=%s))',
                'baseDn' => 'CN=Users,DC=domain,DC=local',
                'bindRequiresDn' => false,
                'optReferrals' => false
            )), 
            $username, 
            $password
        );
        $result = $auth->authenticate($adapter);

        print_r($result);
    }

}

after starting this action, the following error displays "0x7002: LDAP extension not loaded",

/var/www/coasting/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Ldap.php(140): Zend \ Ldap \ Ldap → __ construct ()

/var/www/coasting/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Ldap.php(205): Zend \ Authentication \ Adapter \ Ldap-> getLdap ()

/var/www/coasting/vendor/zendframework/zendframework/library/Zend/Authentication/AuthenticationService.php(110): Zend \ Authentication \ Adapter \ Ldap-> authenticate ()

How can I solve this error. If any other settings?

+4
source share
1

PHP LDAP.

, PHP LDAP. Phpinfo, , "ldap". LDAP . .

. - "brew php-ldap" Mac "apt-get install php5-ldap" debian ubuntu linux. , .

+3

Source: https://habr.com/ru/post/1548169/


All Articles