Welcome Guest, Not a member yet? Register   Sign In
Problem loading LDAP library
#1

[eluser]Ray Julich[/eluser]
I want to authenticate a username through active directory using a web page form, but I'm getting an error when loading the LDAP library into my application:

Quote:Fatal error: Call to undefined function ldap_connect()


The error occurs obviously when conntecting to the domain controller. The only thing I've changed in the LDAP library is the hostname of my domain controller:

Code:
var $_domain_controllers = array("my_dc");

I've printed out what the php file thinks is the domain controller and it is using the correct one, but the error is occurring at:

Code:
$this->_conn = ldap_connect($dc);

Any ideas on what I could try to get this working?
#2

[eluser]Ray Julich[/eluser]
Should there be a function in the LDAP library called ldap_connet() or is this a built in function?
#3

[eluser]danmontgomery[/eluser]
http://php.net/manual/en/function.ldap-connect.php

You need the php_ldap extension enabled.
#4

[eluser]Ray Julich[/eluser]
Thank you so much. That was all it was.
#5

[eluser]pegas[/eluser]
Hi,

So my gues is that the error will occur if i don't have the server name setup, so the ldap_connect can actually connect to something ?! (I've enabled the ldap module on my apache waamp server and restarted it)

My question is, how can I catch the error mentioned above, and display something else instead ?

Here is my bogus try to do so (the code dose absolutelly nothing :-) )
Code:
// in my controller
        if (!$this->load->library('ldap')){
            $data['connection'] = lang('login_connection_down_text');
        }
        else
            $data['connection'] = 'We are ok !';
    }

//and in my view
<div id="login_status">&lt;?=$connection?&gt;</div>

Thanks for helping me with this.




Theme © iAndrew 2016 - Forum software by © MyBB