Ldap – Able to configure/compile PHP –with-ldap, but LDAP is not listed in phpinfo()

ldapmac-osxphp.iniphp5

I am trying to compile PHP with LDAP support using these lines:

./configure --prefix=/app/php --with-ldap=/usr     
sudo make     
sudo make install

Everything appears to install fine without issue, and PHP runs fine, but when I run a phpinfo, I don't see LDAP listed.

Also, I read somewhere that I could use an ldap.so file in php's ext directory and reference it from php.ini … ? How does on generate the ldap.so file for php … ?

Any ideas? I am on Mac OS X 10.5.8, php 5.2.17.

Update:

I've used these combinations of flags:

--with-ldap
--with-ldap=/usr
--with-ldap=/usr,shared
--with-ldap=shared

Of these, "–with-ldap=shared" produces an ldap.so, which when placed into php's ext directory gives this error in Apache:

PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'ldap.so'  in Unknown on line 0

I've Googled this error, but haven't found much to resolve this issue. Any help is apprecaited!

Many thanks!

KM

Best Answer

After you run configure you need to look in config.log to make sure php is correctly finding ldap.

There is nothing to put in php.ini. On Linux box with only --with-ldap and no php.ini phpinfo yields:

ldap

LDAP Support => enabled
RCS Version => $Id: ldap.c 293036 2010-01-03 09:23:27Z sebastian $
Total Links => 0/unlimited
API Version => 3001
Vendor Name => OpenLDAP
Vendor Version => 20343
Related Topic