dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: PHP LDAP Error 500

  1. #1
    Join Date
    Apr 2015
    Posts
    2

    Question PHP LDAP Error 500

    Greetings!

    i am trying to connect to a windows domain controller using LDAP function of PHP. This is the code so far

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    
    <body>
     <?php
     // using ldap bind
    $ldaprdn  = $_POST["username"];     // ldap rdn or dn
    $ldappass = $_POST["passwd"];  // associated password
    $ldaphost = "192.168.4.1";  // your ldap servers
    $ldapport = 389; 
    
    
    // Connecting to LDAP
    $ldapconn = ldap_connect($ldaphost, $ldapport)
              or die("Could not connect to $ldaphost");
    
    
     ?>
    </body>
    </html>
    Simple as it is but it gives me an internal server error 500. The server is ubuntu 14.04 and using apache-php.

    Gladly appreciate your help in advance. Thanks

  2. #2
    Join Date
    Apr 2015
    Posts
    2

    Wink

    Just got resolved it. It seems that I havent installed the ldap support for php5 in Ubuntu. The following command should be used:

    Code:
    sudo apt-get install php5-ldap
    /etc/init.d/apache2 restart

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles