LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trying to ./configure php, getting ldap library error (https://www.linuxquestions.org/questions/linux-newbie-8/trying-to-configure-php-getting-ldap-library-error-4175549079/)

raphael75 07-27-2015 01:32 PM

Trying to ./configure php, getting ldap library error
 
I'm trying to ./configure PHP 5.6.11 on Debian 8.1. It gets to this line and stops:

Code:

checking for LDAP Cyrus SASL support... no
checking size of long int... 8
configure: error: Cannot find ldap libraries in /usr/include.

I can't figure out what ldap it's looking for. I don't know if this is helpful (and I'm not sure exactly what the output means):

Code:

dpkg -l *ldap*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                  Version          Architecture    Description
+++-======================-================-================-==================================================
un  dovecot-ldap          <none>          <none>          (no description available)
un  ldap-utils            <none>          <none>          (no description available)
un  libapache2-mod-ldap-us <none>          <none>          (no description available)
un  libapache2-mod-vhost-l <none>          <none>          (no description available)
un  libaprutil1-ldap      <none>          <none>          (no description available)
un  libldap-2.3-0          <none>          <none>          (no description available)
ii  libldap-2.4-2:amd64    2.4.40+dfsg-1    amd64            OpenLDAP libraries
ii  libldap-2.4-2-dbg:amd6 2.4.40+dfsg-1    amd64            Debugging information for OpenLDAP libraries
un  libldap-dev            <none>          <none>          (no description available)
un  libldap2              <none>          <none>          (no description available)
ii  libldap2-dev:amd64    2.4.40+dfsg-1    amd64            OpenLDAP development libraries
un  libnet-ldap-perl      <none>          <none>          (no description available)
un  libopenldap-dev        <none>          <none>          (no description available)
un  libsasl2-modules-ldap  <none>          <none>          (no description available)
rc  php5-ldap              5.6.9+dfsg-0+deb amd64            LDAP module for php5
un  sudo-ldap              <none>          <none>          (no description available)

here is the ./configure code:

Code:

./configure
--with-apxs2=/usr/local/apache2/bin/apxs
--with-mysql
--with-pdo-mysql=mysqlnd
--with-openssl
--with-gd
--with-zlib
--enable-shmop
--enable-sockets
--enable-sysvsem
--enable-sysvshm
--enable-mbstring
--with-iconv
--with-litespeed
--with-ldap
--with-mcrypt
--enable-gd-native-ttf
--with-png
--with-ttf
--with-freetype-dir=/usr/local/lib/
--enable-calendar
--enable-zip

Please help, thanks!

AlucardZero 07-27-2015 08:24 PM

Reinstall libopenldap-dev and/or libldap-dev, probably

raphael75 07-28-2015 01:41 PM

I tried this:
Code:

xyz@comp:/usr# apt-get install libopenldap-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libopenldap-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libldap2-dev

E: Package 'libopenldap-dev' has no installation candidate

Code:

xyz@comp:/usr# apt-get install libldap-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libldap2-dev' instead of 'libldap-dev'
libldap2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Code:

xyz@comp:/usr# apt-get install libldap2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libldap2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Apparently these don't exist or I have the latest version. I'm not sure what to do now.

ondoho 07-29-2015 02:56 PM

do you want to compile php from source?
why?
why not just install it from the repos?
Code:

$ sudo -i
# apt-get update
# apt-get upgrade
# apt-get install php5


raphael75 07-30-2015 06:32 AM

Because we need several compile options that I don't think come with the repository version - ldap, pdo, gd, zip.

Are those in the repository version?

ondoho 07-31-2015 07:03 AM

aren't those modules, that have to be installed seperately?
they are rather common requirements for e.g. various cms's, and i always solved it by installing the according php5-* module and restarting apache2.

i still don't see any reason to compile php from scratch.

what sort of server os are you running, and what are you trying to achieve with your server?
fwiw, on a simple debian stable home server (lists installed php packages):
Code:

$ dpkg-query -l 'php5*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name          Version      Architecture Description
+++-==============-============-============-=================================
ii  php5          5.6.9+dfsg-0 all          server-side, HTML-embedded script
un  php5-cgi      <none>      <none>      (no description available)
ii  php5-cli      5.6.9+dfsg-0 i386        command-line interpreter for the
ii  php5-common    5.6.9+dfsg-0 i386        Common files for packages built f
ii  php5-curl      5.6.9+dfsg-0 i386        CURL module for php5
un  php5-dev      <none>      <none>      (no description available)
un  php5-fpm      <none>      <none>      (no description available)
ii  php5-gd        5.6.9+dfsg-0 i386        GD module for php5
ii  php5-json      1.3.6-1      i386        JSON module for php5
ii  php5-mcrypt    5.6.9+dfsg-0 i386        MCrypt module for php5
un  php5-mhash    <none>      <none>      (no description available)
ii  php5-mysql    5.6.9+dfsg-0 i386        MySQL module for php5
un  php5-mysqli    <none>      <none>      (no description available)
un  php5-mysqlnd  <none>      <none>      (no description available)
ii  php5-readline  5.6.9+dfsg-0 i386        Readline module for php5
un  php5-suhosin  <none>      <none>      (no description available)
un  php5-user-cach <none>      <none>      (no description available)
un  php5-xcache    <none>      <none>      (no description available)
un  php5-xdebug    <none>      <none>      (no description available)

you can also try the
Code:

<?php phpinfo();
function to see what you have.

zeebra 07-31-2015 07:55 AM

When you configure it checks that the correct version of the library is there. And in your case, its not.

Since you are compiling your own version of PHP, its pretty safe to say that your distro probably did not compile the correct version of the library and that your PHP version most likely need a newer version.

What system are you running? 64bit or 32bit? And is the software 64bit? If you are on 64bit and running 32bit software, you need to install the 32bit libs.

You should probably just compile and build the library yourself and not using the package manager.

Perhaps you need to symlink the correct lib file to the name of the file which your configure script is looking for.


Other than that, I am not sure. I have not used debian that much, but I can also remember having had some similar issues before, but a long time ago now.

Not sure about PHP package exactly, but if its the opposite way and you need the older ldap lib, then it could be you can just symlink the "name" of the lib to the newer version.

ondoho 08-01-2015 06:35 AM

Quote:

Originally Posted by raphael75 (Post 5396963)
I'm trying to ./configure PHP 5.6.11 on Debian 8.1.

i missed this line.

on my debian stable it's:
Code:

$ php --version
PHP 5.6.9-0+deb8u1 (cli) (built: Jun  5 2015 11:47:09)

so that is probably the reason why you want to compile your own.

but,
i'm still sticking to my conservative views:

- there's a reason why debian stable is at 5.6.9 atm, and you will have a hard time getting a higher version. there's some backporting for jessie, but you might be easier off just changing to debian testing (but losing stability).

- again, why do you think you need this higher version? maybe there's an easier approach.

raphael75 08-02-2015 02:33 PM

Quote:

Originally Posted by ondoho (Post 5399309)
i missed this line.

on my debian stable it's:
Code:

$ php --version
PHP 5.6.9-0+deb8u1 (cli) (built: Jun  5 2015 11:47:09)

so that is probably the reason why you want to compile your own.

but,
i'm still sticking to my conservative views:

- there's a reason why debian stable is at 5.6.9 atm, and you will have a hard time getting a higher version. there's some backporting for jessie, but you might be easier off just changing to debian testing (but losing stability).

- again, why do you think you need this higher version? maybe there's an easier approach.

Because I need these features:

ldap
pdo
gd
zip

and as far as I know, they can only be added at compile.

Is it possible to add them after compiling?

Do they come with the apt-get version?

ondoho 08-03-2015 06:09 AM

Quote:

Originally Posted by raphael75 (Post 5399890)
Because I need these features:
ldap
pdo
gd
zip

who or what exactly "needs" these features, and how do you think you know that (link to documentation)?

as i wrote before, this looks very much like system requirements for some CMS.
i am not good with those things, but i recently tried literally dozens of them, and not once have i come across one that would not run on debian stable with aforementioned php version.

i did have to install some extra modules (as i also mentioned before).
Have you tried that instead?

raphael75 08-03-2015 07:15 AM

They are for our intranet site that I created. It uses LDAP for authentication, gd for images, PDO for communication with MySQL, and zip for PHPExcel. So I know what the site needs.

raphael75 08-03-2015 12:44 PM

I tried the apt-get version of PHP5 (5.6.9). Turns out it does include those features, so it should be good, even though it's a few revisions behind.


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