php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28400 ldap cannot connect (nothing send on network)
Submitted: 2004-05-14 15:48 UTC Modified: 2004-07-02 11:28 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: thu at nykredit dot dk Assigned:
Status: Closed Package: LDAP related
PHP Version: 5.0.0RC2 OS: Linux debian testing
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: thu at nykredit dot dk
New email:
PHP Version: OS:

 

 [2004-05-14 15:48 UTC] thu at nykredit dot dk
Description:
------------
Ldap_connect does not work.. tcpdump shows no traffic on the network when trying to connect..

>dpkg -s |grep ldap gives:
ii  ldap-utils     2.1.23-1       OpenLDAP utilities
ii  libldap2       2.1.23-1       OpenLDAP libraries
ii  libldap2-dev   2.1.23-1       OpenLDAP development libraries

The compile went fine and ldap show up as expected in phpinfo()
LDAP Support 	enabled
RCS Version 	$Id: ldap.c,v 1.151 2004/04/06 23:14:06 iliaa Exp $
Total Links 	0/unlimited
API Version 	2004
Vendor Name 	OpenLDAP
Vendor Version 	20123


I have compiled with the following directives:
'./configure' '--with-mysql' '--with-apxs' '--with-gd' '--with-openssl' '--with-zlib' '--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-dio' '--enable-ftp' '--with-ttf' '--enable-gd-native-ttf' '--with-kerberos' '--with-imap-ssl' '--with-mcrypt' '--enable-embedded-mysqli' '--enable-soap' '--with-xsl' '--with-pear' '--with-ming' '--with-oci8' '--with-ldap'

Reproduce code:
---------------
<?php
$connect = ldap_connect($server);
if ($connect) {
    echo "Connected OK - That is the server ($server) is     }else {
    echo "Connect FAILED server=($server)";
}
?>

Expected result:
----------------
I want to get a valid ldap connection, like I do when I run the script on another server with PHP4..



Actual result:
--------------
ldap_connect() just returns null...
Nothing is ever sent on the network.. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-17 22:53 UTC] pollita@php.net
The reason nothing is sent over the network has to do with how the OpenLDAP library handles "connections".  Even under the best cirsumstances an ldap_connect() doesn't actually contact the remote server until you reach the ldap_bind() stage.

Of the reasons ldap_connect() would return false, the only one which does not generate an error message is a specific form of initialization error, can you check your main/php_config.h file for a line containing LDAP_API_FEATURE_X_OPENLDAP and paste any lines containing it (plus a couple above/below for context)?

ldap_connect() never returns NULL however, are you certain that's what you're getting back and not FALSE?

 [2004-05-25 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2004-05-25 08:34 UTC] thu at nykredit dot dk
Well actually ldap_connect returns false and not null..
Also there may be a resonable explanation that it does not send anything on the network.. But
How can it be that I do not get a valid handle then (as it cannot determine whether it can or cannot connect to the server without trying).
The script works fine on another server running php4.
 [2004-06-04 15:10 UTC] thu at nykredit dot dk
main/php_config.h does not contain a line like: "LDAP_API_FEATURE_X_OPENLDAP"..
I have not changed anything in this file - it is the original file from RC2..
 [2004-07-02 11:28 UTC] thu at nykredit dot dk
It works with PHP5 RC3 on a Fedora 2... 
So.. something with my debian installation must have caused the trouble, or the error have been fixed...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 15:01:56 2024 UTC