Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

php_ldap.dll - ldap_connect()

Featured Replies

I copied this file (php_ldap.dll) into /php/extensions and uncommented "extension=php_ldap.dll" in the php.ini

 

For some reason the function still is not found. Is there anything else I need to do to enable this function?

  • Author

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

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.

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 :)

  • Author

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

  • 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

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...

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.