LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   configure PHP with LDAP server (https://www.linuxquestions.org/questions/linux-server-73/configure-php-with-ldap-server-4175500000/)

said76 03-31-2014 12:28 AM

configure PHP with LDAP server
 
Hi,

I believe I have posted the following question before last year but did not manage to get the solution to the problem.

I have installed PHP from the source on my Ubuntu Server 12.04.03, and it's working fine. Now, the problem I have is to make the PHP to work with LDAP server. I need the LDAP because I want to be able to run a global address book. The webmail I use, roundcube, keeps complaining that I need to support LDAP with my PHP.

So, I re-installed my PHP-5.5.10 with LDAP as follows:
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/lib --with-zlib --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-ldap

With this, I got an error message "configure: error: Cannot find ldap libraries in /usr//usr/local/ssl/lib"

I then found that my ldap resides at /usr/lib/i386-linux-gnu/
libldap-2.4.so.2
libldap.a
libldap_r-2.4.so.2
libldap_r-2.4.so.2.8.1
libldap_r.a
libldap_r.so
libldap.so

Hence, I went to make a small change to my configuration:
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/lib --with-zlib --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-ldap=/usr/lib/i386-linux-gnu/

This time, I run it and received a different error: "configure: error: Cannot find ldap.h"

I found that my ldap.h is located in /usr/include

I'm not sure if I have installed LDAP correctly. The way I installed LDAP server is via the command "aptitude install slapd ldap-utils"

I wonder if I have missed any crucial steps here. I tried to find the solution on the Internet but to no avail so far.

Any help or direction would be very much appreciated.

Thank you

bathory 03-31-2014 02:37 AM

Hi,

You should also install libldap-2.4-2 and libldap2-dev if not already installed.
And I guess you need to specify /usr in the ./configure script options[
CODE]./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/lib --with-zlib --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-ldap=/usr[/CODE]

said76 04-01-2014 07:49 PM

Thank you for replying.

I believe they have been installed because if I run the below command, it said nothing to be installed.

$ aptitude install libldap-2.4-2 libldap2-dev
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

Also, I included "/usr" in the configuration script option as suggested, it still gives me the same error message
Code:

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/lib --with-zlib --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-ldap=/usr
Output:
...
checking for LDAP support... yes
checking for LDAP Cyrus SASL support... no
configure: error: Cannot find ldap libraries in /usr//usr/local/ssl/lib.

Thank you

bathory 04-02-2014 12:46 AM

Quote:

checking for LDAP support... yes
checking for LDAP Cyrus SASL support... no
configure: error: Cannot find ldap libraries in /usr//usr/local/ssl/lib.
Looks like a known php bug
There is a workaround at the last post, but it works for 64bit systems, so you have to change it accordingly to suit your 32bit arch.


All times are GMT -5. The time now is 05:05 PM.