Cannot get LDAP compiled within PHP

webguy

Verified User
Joined
Apr 13, 2005
Messages
41
Location
Best, Netherlands
Hi all,

I am running a CentOS 5.9 machine.
I cannot get LDAP compiled inside PHP, any help would be very much appreciated.

I am using custombuild and I have added inside /usr/local/directadmin/custombuild/configure/ap2/configure.php5 the following line:
--with-ldap \

On my machine I found the following:
/usr/lib/libldap.so is available (symlink to /usr/lib/libldap-2.3.so.0.2.31)
/usr/lib/libldap_r.so is available (symlink to /usr/lib/libldap_r-2.3.so.0.2.31)

ldap.h is present in:

/usr/lib64/evolution-openldap/include/ldap.h
/usr/lib/evolution-openldap/include/ldap.h
/usr/include/ldap.h

When I run a ./build php n I get:

checking for LDAP support... no
checking for LDAP Cyrus SASL support... no

I am compiling PHP in CGI mode.
What could be wrong here? Thanks in advance!
 
Hello,

A small fix: http://help.directadmin.com/item.php?id=252
You should not change configure/ap2/configure.php5, just copy it to custom/ap2/configure.php5

Code:
cp -fp configure/ap2/configure.php5 custom/ap2/configure.php5

Then add your changes to custom/ap2/configure.php5.

You might need to specify the both with DIR:

Code:
--with-ldap=/usr \
--with-ldap-sasl=/usr

LDAP support in PHP is not enabled by default. You will need to use the --with-ldap[=DIR] configuration option when compiling PHP to enable LDAP support. DIR is the LDAP base install directory. To enable SASL support, be sure --with-ldap-sasl[=DIR] is used, and that sasl.h exists on the system.

http://www.php.net/manual/en/ldap.installation.php
 
Hi Alex,
Thanks for your suggestion, I believe it is working now. My servers runs SuPHP so I had to add the modifications to /usr/local/directadmin/custombuild/custom/suphp/configure.php5:

"--with-ldap=/usr" \
"--with-ldap-sasl=/usr"

And I now see LDAP support: enabled in phpinfo ;-)

Regards, Rene
 
Back
Top