Jump to content
The Uniform Server Community

php_ldap.dll - ldap_connect()


Stettin
 Share

Recommended Posts

If you did this while the server was running, shut it down and restart the server.

 

I did that :)

 

I tried running phpinfo() to see if it was loading, but all I saw was:

 

extension_dir /usr/local/PHP/extensions /usr/local/PHP/extensions

 

I grabbed the file from the php.net windows zip file in /ext

Link to comment
Share on other sites

Ok, you also have to make sure that the extension was grabbed form the same version of PHP as on 4.0.

 

After that make sure theserver is shut down.

 

Copy the extension to /user/local/php/extensions/ under the UniServer directory.

 

Make the php.ini modifications.

 

Start the server...

 

Let me know.

Link to comment
Share on other sites

I have just checked this out on a clean install of Mona

 

Enabled line (576) in UniServer\udrive\usr\local\php\php.ini as shown (removed the semi-colon):

extension=php_ldap.dll

 

Ran the servers! I was surprised, they did not fall over, just get a warning in Apache’s log file.

 

Copied the following file: php-5.2.8-Win32\ext\php_ldap.dll

 

To folder: UniServer\udrive\usr\local\php\extensions

 

Restarted the servers, from Apanel selected phpinfo()

About halfway down the page you will see a section for ldap, this confirms it is enabled.

 

Does not guarantee that it is working. I have no access to a ldap server hence use an on-line service using this code:

 

<?php
$conn = ldap_connect("root.openldap.org","389") or die("Could not connect to server");  // specify LDAP server
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
$r = ldap_bind($conn) or die("Could not bind to server");   // bind to the LDAP server specified above   
$result = ldap_search($conn,"dc=openldap,dc=org", "(cn=*)") or die ("Error in search query");  
ldap_close($conn);
print "No errors displayed connection was OK";
?>

 

Save it as test.php in folder: UniServer\udrive\www

Restart the servers and type: http://localhost/test.php into your browser.

 

All you should see is the line: No errors displayed connection was OK

 

Any errors then it failed.

 

All the best

Ric :)

Link to comment
Share on other sites

I have just checked this out on a clean install of Mona

 

Enabled line (576) in UniServer\udrive\usr\local\php\php.ini as shown (removed the semi-colon):

extension=php_ldap.dll

 

Ran the servers! I was surprised, they did not fall over, just get a warning in Apache’s log file.

 

Copied the following file: php-5.2.8-Win32\ext\php_ldap.dll

 

To folder: UniServer\udrive\usr\local\php\extensions

 

Restarted the servers, from Apanel selected phpinfo()

About halfway down the page you will see a section for ldap, this confirms it is enabled.

 

Does not guarantee that it is working. I have no access to a ldap server hence use an on-line service using this code:

 

<?php
$conn = ldap_connect("root.openldap.org","389") or die("Could not connect to server");  // specify LDAP server
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
$r = ldap_bind($conn) or die("Could not bind to server");   // bind to the LDAP server specified above   
$result = ldap_search($conn,"dc=openldap,dc=org", "(cn=*)") or die ("Error in search query");  
ldap_close($conn);
print "No errors displayed connection was OK";
?>

 

Save it as test.php in folder: UniServer\udrive\www

Restart the servers and type: http://localhost/test.php into your browser.

 

All you should see is the line: No errors displayed connection was OK

 

Any errors then it failed.

 

All the best

Ric :)

"Restarted the servers, from Apanel selected phpinfo()

About halfway down the page you will see a section for ldap, this confirms it is enabled."

 

It does not show up in phpinfo()... Not sure why. I think I'm just going to use my windows share workaround and copy my stuff over to the linux box manually after I rebuild my sites. Thanks for the help though.

 

Fatal error: Call to undefined function ldap_connect() in Y:\www\test.php on line 2

Link to comment
Share on other sites

  • 6 months later...

I have just checked this out on a clean install of Mona

 

Enabled line (576) in UniServer\udrive\usr\local\php\php.ini as shown (removed the semi-colon):

extension=php_ldap.dll

 

Ran the servers! I was surprised, they did not fall over, just get a warning in Apache’s log file.

 

Copied the following file: php-5.2.8-Win32\ext\php_ldap.dll

 

To folder: UniServer\udrive\usr\local\php\extensions

 

Restarted the servers, from Apanel selected phpinfo()

About halfway down the page you will see a section for ldap, this confirms it is enabled.

 

Does not guarantee that it is working. I have no access to a ldap server hence use an on-line service using this code:

 

<?php
$conn = ldap_connect("root.openldap.org","389") or die("Could not connect to server");  // specify LDAP server
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
$r = ldap_bind($conn) or die("Could not bind to server");   // bind to the LDAP server specified above   
$result = ldap_search($conn,"dc=openldap,dc=org", "(cn=*)") or die ("Error in search query");  
ldap_close($conn);
print "No errors displayed connection was OK";
?>

 

Save it as test.php in folder: UniServer\udrive\www

Restart the servers and type: http://localhost/test.php into your browser.

 

All you should see is the line: No errors displayed connection was OK

 

Any errors then it failed.

 

All the best

Ric :)

Hi,

I am running US 3.5. I have added the correct.dll file, uncommented in php.ini, but when I run the above script, I receive the Failed to bind message. I can see LDAP in phpinfo. How can I troubleshoot this?

Many thanks,

Jeff

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...