7

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.

2
  • 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 Commented Nov 1, 2012 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. Commented Nov 1, 2012 at 22:05

1 Answer 1

13

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.

2
  • 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. Commented Nov 1, 2012 at 16:25
  • 1
    confirmed fix for Ubuntu 13.10 Commented Oct 21, 2013 at 20:47

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.