Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to compile PHP on Ubuntu 12.10 with LDAP support. I have run:

apt-get install libldap2-dev

That installs the header files to /usr/include.

However, when attempting to compile it is unable to locate the header files. I have tried to with --with-ldap=/usr/include as well and it still fails with:

configure: error: Cannot find ldap.h

I also tried symlinking with the following and I still get the same error:

ln -s /usr/lib/ldap* /usr/lib/

Thanks in advance for your help.

share|improve this question
1  
I'm sure I'm missing something here, but why are you compiling LDAP support in Ubuntu? There is a package in the repos for it: sudo apt-get install php5-ldap –  Soviero Nov 1 '12 at 16:29
    
php5-ldap installs php5-common, which for some reason installs PHP 5.4.6~ubuntu CLI. I'm compiling PHP 5.4.8 from source. –  Andrew Ellis Nov 1 '12 at 22:05
add comment

1 Answer 1

https://bugs.php.net/bug.php?id=49876 explains this behavior.

To fix this, simply run the following:

ln -fs /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/

Vola, compiling away.

share|improve this answer
    
Also worth noting in case you're wondering... --with-libdir=lib64 causes other parts of the configuration to fail. This is why you have to symlink lib64 libraries individually. –  Andrew Ellis Nov 1 '12 at 16:25
1  
confirmed fix for Ubuntu 13.10 –  ehime Oct 21 '13 at 20:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.