Jump to content

"call to undefined function ldap_connect" and LDAP section not in phpinfo()


dcparham

Recommended Posts

forgive if this's alread posted, found nothing, and precious little on the internet regarding LDAP not in phpinfo().

 

am getting errormsg "call to undefined function ldap_connect".  i installed using "sudo apt-get install php5-ldap" and restarted Apache; ALSO there is no LDAP section in phpinfo().

 

what files need what settings/configurations to ensure LDAP is working?  i feel like i am spending way too much time on this step!

Link to comment
Share on other sites

hello, fly - BTW "Ubuntu 8.04" [sorry did not specify before!]; i added to the correct php.ini file, in the area that looks like where the extension statement would go, by simply pasting:  "extension=mod_ldap.so" no quotes.  here is the section of the php.ini:

 

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
;   extension=msql.dll
;
; ... or under UNIX:
;
;   extension=msql.so
extension=mod_ldap.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here.  Specify the location of the extension with the
; extension_dir directive above.

 

THEN restarted apache, reran phpinfo(), and there is no LDAP section.  i even added to my code what your salutation footer shows:  "error_reporting(E_ALL);" and "ini_set('display_errors', 1);"  the phpinfo() when searching for LDAP via ctl-f and by eye - no LDAP section; mention of some ldap files but no ldap section. any ideas?

Link to comment
Share on other sites

hi, Fly - one would think a simple "where is Ubuntu extensions directory?" would yield something, but so far i do not know where that directory is - is it different that the Extensions section of php.ini? ["Dynamic Extensions"].  see the code i posted: it is in the "Dynamic Extensions" section, yes - not sure URL's are allowed but if so, this url showed the syntax as i entered it: http://www.linuxquestions.org/questions/ubuntu-63/just-installed-ubuntu...-got-a-question-ldapphp-505689/.  i had added the extension=mod_ldap.so in the php.ini file.  thx again for your help!

Link to comment
Share on other sites

ok - using your terminology exactly got me farther, and found in /usr/lib/php5/ldap.so - so i added in php.ini Dynamic Extensions section stmt: extension=ldap.so - and now i am [!viola!] at least seeing this in the phpinfo() [will copy and paste from the "ldap" section that now exists in phpinfo()]:

ldap
LDAP Support  enabled  
RCS Version  $Id: ldap.c,v 1.161.2.3.2.11 2007/07/17 09:09:42 jani Exp $  
Total Links  0/unlimited  
API Version  3001  
Vendor Name  OpenLDAP  
Vendor Version  20409  
SASL Support  Enabled

 

now, the "undefined function ldap_connect" has disappeared, and in its place is [again]: "Search: Can't contact LDAP server" - round and round we go.  the line that causes the error is:

 

$results = ldap_search($ldapLink, $dn, "givenName=[person's first name here]");

 

[shifting wall-banging helmet due to poor scalp-padding]  ((([8])))

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.