Operating System - HP-UX
1826123 Members
4719 Online
109690 Solutions
New Discussion

HP-UX apache 2.0.49: php calling ldap_connect core dumps

 
Herbert Neugebauer
New Member

HP-UX apache 2.0.49: php calling ldap_connect core dumps

we've got the HP-UX apache-based web-server running (currently at 2.0.49) and are trying to develop ldap queries from PHP scripts.

A call to ldap_connect("ldap.server.com", 389)
just returns an invalid connection, so the initialization fails.
A call to lcap_connect("ldap://ldap.server.com/") even core dumps.

We downloaded this apache from www.software.hp.com and since 2.0.48 the web-server should contain everything necessary to use ldap functions from within PHP.

Any tips, ideas?

Thanks

Herbert
3 REPLIES 3
Steve Lewis
Honored Contributor

Re: HP-UX apache 2.0.49: php calling ldap_connect core dumps

I do it this way. Using the hostname of the domain controller didn't work even though it resolves fine using nslookup/nsquery, so I used the IP.

#!/opt/perl/bin/perl

use Net::LDAP;

my $uid = $ARGV[0];

$ldap = Net::LDAP->new( 'IP-address-of-Domain-controller' ) or die "$@";

$mesg = $ldap->bind ;

$mesg = $ldap->search(
base => 'c=UK',
scope => 'sub',
filter => "(&(uid=$uid))"
);


my $max = $mesg->count;
for ( $i = 0 ; $i < $max ; $i++ ) {
my $entry = $mesg->entry ( $i );
foreach my $attr ( $entry->attributes ) {
print "$attr : ";
print $entry->get_value( $attr ) . "\n";
}
}
print "\n";
Herbert Neugebauer
New Member

Re: HP-UX apache 2.0.49: php calling ldap_connect core dumps

Thanks for the PERL example, it works on the same Unix machine, but as my problem is in PHP, it did not really help solve my problem.

In the meantime apache/PHP is upgraded to the latest version 2.0.52/4.3.8 from software.hp.com.
Situation did not really improve, the ldap_connect now get a resource identifier with ldap_connect("servername", 389) but then the ldap_bind fails with "can't connect to the LDAP server". The ldap_connect("ldap://servername/") still core-dumps.
I'm not using secure ldap, no SSL, just plain unprotected LDAP connection.

As mentioned above: the LDAP server itself definitely works, it'd the company main LDAP, and can be connected from my PC with a LDAP-browser applet and with the PERL tool in the other reply. Just not with PHP.

Any clues?

Herbert
Herbert Neugebauer
New Member

Re: HP-UX apache 2.0.49: php calling ldap_connect core dumps

Ups, I forgot to post the resolution here that I found a few week later after I had give up at first.

...

order of PHP module includes!

We are using a PHP module to access an Oracle Database. Obviously the oracle shared libraries also contain a function ldap_connect.... so when the Oracle module was included FIRST in the PHP configuration, before the LDAP include, the ldap functions wouldn't work. Or better probably the Oracle functions have a different syntax, maybe they would work if I used the right function parameters.

Changing the ORDER solves my problem: first include the LDAP functions and then Oracle. In this order both the Oracle Database access functions and my LDAP code works well!

Regards

Herbert