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

Re: how do you enable protocol version 2 support?



You put that command in whatever file is doing the ldap_connect.

IE...

connection.php

$conn = ldap_connect('127.0.0.1');
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
$bind = ldap_bind....

Check out www.php.net for more examples... specifically:

http://www.php.net/manual/en/function.ldap-set-option.php
http://www.php.net/manual/en/function.ldap-bind.php
http://www.php.net/manual/en/function.ldap-connect.php

> ok, i just added....
>
> ldap_set_option($connectId, LDAP_OPT_PROTOCOL_VERSION, 3);
>
> to my php.ini  file but it did not do any good. i am still getting:
>
> Could not bind to ldap server: Protocol error
>
> when trying to run phpqladmin. the only way i have been able to get the
> script to run was to enable v2 support in openldap but i really dont
> want to do that and would rather use v3. i am using php-4.3.1 via the
> mod option to apache.
>
> Thanks in advance.
>
>
> Ming Deng wrote:
>
>> BsD JuNkiE wrote:
>>
>>> How do you enable protocol v2 support in openldap 2.1.x? I am trying
>>> to get a php / ldap script (phpQLADMIN) to work and unfortunately php
>>>  only supports ldapV2 so i am getting unable to bind to ldap server:
>>> protocol error. I found in the documentation the difference between
>>> the two protocols but not how to enable v2.
>>>
>>> Thanks in advance and have a great day.
>>>
>> By default, php-ldap(it is a rpm come with php)  use protocol 2.  You
>> can set php to use protocol 3 by:
>>
>> ldap_set_option($connectId, LDAP_OPT_PROTOCOL_VERSION, 3);
>>
>> Ming