Bing, Run <?php phpinfo(); ?>
If you don't see a section for LDAP, it's not installed. In a Windows XP, PHP 4.3.6 environment, installed in C:/Program Files/PHP,I had to change a working default installation as follows to get it to work: Add to php.ini: extension_dir = C:/Program Files/PHP/extensions/ extension=php_ldap.dll ldap.max_links = -1 Copy C:\Program Files\PHP\php.ini to C:\WINDOWS Restart Apache to make sure your new ini file controls. You should see the options in your ini file reflected in the phpinfo display. Copy C:\Program Files\PHP\php4ts.dll to C:\WINDOWS. Copy from C:\Program Files\PHP\extensions to C:\Windows\System32 php_ldap.dll libeay32.dll ssleay32.dll Copy all the dlls in C:/Program Files to C:\Windows\System32 Good luck! Bing Du wrote: > Greetings, > I've installed PHP with ldap. But I got this error "Fatal error: Call to > undefined function: ldap_connect() in /home/me/public_html/test1.php on > line 5". Why ldap_connect() is undefined? > This is what I did: > ========== > # ./configure --with-apxs=/usr/local/apache/bin/apxs > --with-config-file-path=/usr/local/apache/php.ini --with-mysql --with-zlib > --with-ldap > # make > # make install > ========== > It went through without obvious errors. > And this is the PHP script test1.php that generates the above error: > ==== > <?php > $dn="cn=john smith, ou=Users, ou=eng,dc=iastate, dc=edu"; > $password = "ok4now"; > if (!($ldap = ldap_connect("w2kdc1.eng.some.edu", 389))) { > die ("Could not connect to LDAP server"); > } > if (!($res = @ldap_bind($ldap, $dn, $password))) { > die ("Could not bind to $dn"); > } > echo "bind fine!"; > ?> > ==== > So my question is how to verify PHP has been installed with ldap support? > Thanks in advance for any help, > Bing -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php