PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Sep 20, 2017 7:57 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Aug 29, 2017 4:26 pm 
Offline
Forum Newbie

Joined: Tue Aug 29, 2017 4:20 pm
Posts: 10
Location: Juneau, AK
I have been beating myself up for weeks trying to get this to compile, I'm hoping to get some assistance. Could somebody help me troubleshoot and compile this?

https://pastebin.com/DA2wdQug


Top
 Profile  
 
PostPosted: Wed Aug 30, 2017 1:23 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6550
Location: WA, USA
What LDAP library do you have installed (OpenLDAP?) and what version?


Top
 Profile  
 
PostPosted: Wed Aug 30, 2017 1:39 pm 
Offline
Forum Newbie

Joined: Tue Aug 29, 2017 4:20 pm
Posts: 10
Location: Juneau, AK
Hi requinix, I have installed the following Solaris packages:

Syntax: [ Download ] [ Hide ]
$ pkg list | ggrep ldap
library/apr-util-15/apr-ldap                      1.5.4-0.175.3.0.0.30.0     i--
library/openldap                                  2.4.30-0.175.3.20.0.3.0    i--
naming/ldap                                       0.5.11-0.175.3.0.0.30.0    i--


You can find more specific details (and what files are distributed) about these packages are here:
http://pkg.oracle.com/solaris/release/e ... ion=Search

I just recently started working with Solaris (about a year ago) -- I have extensive Linux experience, but this is a different animal.

I can compile PHP fine (without LDAP) But I really need ldap to work.
Thank you for helping me through this!


Top
 Profile  
 
PostPosted: Wed Aug 30, 2017 4:00 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6550
Location: WA, USA
Take a look at your ldap.h and see how it compares to the version I have from Ubuntu.


Top
 Profile  
 
PostPosted: Thu Aug 31, 2017 2:05 pm 
Offline
Forum Newbie

Joined: Tue Aug 29, 2017 4:20 pm
Posts: 10
Location: Juneau, AK
Ok, so I removed the 'ldap' package so now the only thing I have is 'openldap'.

There are two different ldap.h - one at /usr/include/ldap.h and one at /usr/include/openldap/ldap.h. Here are the diffs for that, the /usr/include/ldap.h is not even close.

(Your file is on the left)
/usr/include/ldap.h

/usr/include/openldap/ldap.h

I tried changing the configure script to --with-ldap=/usr/include/openldap but it complains that it can't find ldap.h.

Edit: Your file is on the left, not the right.


Top
 Profile  
 
PostPosted: Thu Aug 31, 2017 3:23 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6550
Location: WA, USA
So the OpenLDAP one looks better. In fact it seems like PHP doesn't even support the Solaris version (PHP and Solaris don't always work well together as it is...).

Unfortunately PHP's configure script isn't terribly flexible when it comes to stuff like this. The way forward I'm looking at is to put all the OpenLDAP files into one central location, with a /lib for libraries and /include for headers. You could compile OpenLDAP yourself, or create a temporary directory with symlinks to the appropriate locations
Code:
/foo/lib -> /usr/lib/??? (maybe openldap or $arch/openldap or similar)
/foo/include -> /usr/include/openldap

then configure --with-ldap=/foo.

When this is all working you could also create a bug report for supporting building ext/ldap against OpenLDAP on Solaris explaining what you've found.


Top
 Profile  
 
PostPosted: Fri Sep 01, 2017 1:31 pm 
Offline
Forum Newbie

Joined: Tue Aug 29, 2017 4:20 pm
Posts: 10
Location: Juneau, AK
I built BerkeleyDB.5.0 without hitch, and now it's in /usr/local/BerkeleyDB.5.0

Now, trying to build OpenLDAP (again, I tried doing this weeks ago but now I'm determined to get this going), I'm running into a problem (which is probably outside of the scope of this forum) but I can't compile it.

LDFLAGS="-L/usr/local/BerkeleyDB.5.0/lib" CPPFLAGS="-I/usr/local/BerkeleyDB.5.0/include" LD_LIBRARY_PATH="/usr/local/BerkeleyDB.5.0/lib" ../configure


checking db.h usability... yes
checking db.h presence... yes
checking for db.h... yes
checking for Berkeley DB major version... configure: error: Unknown Berkeley DB major version

config.log shows
Syntax: [ Download ] [ Hide ]
configure:27233: result: 7
configure:27265: checking db.h usability
configure:27277: gcc -c -g -O2 -I/usr/local/BerkeleyDB.5.0/include conftest.c >&5
configure:27283: $? = 0
configure:27287: test -z
                         || test ! -s conftest.err
configure:27290: $? = 0
configure:27293: test -s conftest.o
configure:27296: $? = 0
configure:27306: result: yes
configure:27310: checking db.h presence
configure:27320: gcc -E -I/usr/local/BerkeleyDB.5.0/include conftest.c
configure:27326: $? = 0
configure:27346: result: yes
configure:27381: checking for db.h
configure:27388: result: yes
configure:27404: checking for Berkeley DB major version
configure:27517: error: Unknown Berkeley DB major version


If this is something I need to go to the OpenLDAP mailing list I'll do that, I really need this working and I will create a 'blog' about it somewhere.

PS: It's not that I am a sadomasochist, I have to use Solaris for work purposes.


Top
 Profile  
 
PostPosted: Fri Sep 01, 2017 1:38 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6550
Location: WA, USA
I have no idea. You'd have to look at ./configure to see what it's trying to do to test the version number.

You could skip building it and try the symlink approach...


Top
 Profile  
 
PostPosted: Fri Sep 01, 2017 2:05 pm 
Offline
Forum Newbie

Joined: Tue Aug 29, 2017 4:20 pm
Posts: 10
Location: Juneau, AK
That isn't working, I symlinked /lib to ../ and it found ldap.h, but now it says

configure: error: Cannot find ldap libraries in /usr/include/openldap.

And the file it looks like it's looking for "libldap30." doesn't exist. I think compiling OpenLDAP is the way to go so now I'm off down that rabbit hole.

I'll let you know what happens.


Top
 Profile  
 
PostPosted: Fri Sep 01, 2017 3:31 pm 
Offline
Forum Newbie

Joined: Tue Aug 29, 2017 4:20 pm
Posts: 10
Location: Juneau, AK
Ok, after compiling an older version of Berkeley DB (4.6.21), openldap compiled fine, and now PHP compiles with LDAP!

Now it's off to configuring that mess... But hey requinix, I want to thank you for slowing me down in order to take the time to figure it out... Panic and rushing is the worst thing for a programmer, and you just have to slow down and work methodically.

Plus hey, I'm new to the forum so I look forward to helping other people out.


Top
 Profile  
 
PostPosted: Fri Sep 01, 2017 5:07 pm 
Offline
Forum Newbie

Joined: Tue Aug 29, 2017 4:20 pm
Posts: 10
Location: Juneau, AK
I think I spoke too soon, I am now getting some error that doesn't make any sense to me:

...
checking for LDAP support... yes
checking for LDAP Cyrus SASL support... no
checking for 3 arg ldap_set_rebind_proc... yes
checking for ldap_parse_result... no
checking for ldap_parse_reference... no
checking for ldap_start_tls_s... no
checking for ldap_control_find... no
checking for ldap_bind_s... no
configure: error: LDAP build check failed. Please check config.log for more info rmation.
...


Syntax: [ Download ] [ Hide ]
configure:49539: checking for ldap_bind_s
configure:49539: gcc -o conftest -I/usr/include -std=gnu99 -m64 -fvisibility=hidden -I/usr/local/openldap/include -D_POSIX_PTHREAD_SEMANTICS -I/usr/include -L/usr/lib -L/usr/local/openldap/lib -R/usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0 -L/usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0 conftest.c -lldap -llber -lpng -lz -lcurl -lz -lrt -lm -lnsl -lsocket  -lgcc -lxml2 -lssl -lcrypto -lcurl -lidn -lssh2 -lssh2 -lnsl -lsocket -lssl -lcrypto -lssl -lcrypto -lgss -llber-2.4 -lldap_r-2.4 -lz -lsocket -lnsl -lxml2 -lssl -lcrypto  >&5
ld: fatal: recording name conflict: file '/usr/local/openldap/lib/liblber.so' and file '/usr/lib/amd64/liblber-2.4.so' provide identical dependency names: liblber-2.4.so.2
ld: warning: symbol 'ldap_int_global_options' has differing sizes:
        (file /usr/local/openldap/lib/libldap.so value=0x140; file /usr/lib/amd64/libldap_r-2.4.so value=0x180);
        /usr/local/openldap/lib/libldap.so definition taken
collect2: error: ld returned 1 exit status


What is this?..
ld: fatal: recording name conflict: file '/usr/local/openldap/lib/liblber.so' and file '/usr/lib/amd64/liblber-2.4.so' provide identical dependency names: liblber-2.4.so.2


Top
 Profile  
 
PostPosted: Sat Sep 02, 2017 4:12 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6550
Location: WA, USA
The error basically means that you're linking against two different libraries for the same purpose. When building, it should be trying to link with either OpenLDAP's liblber.so or your existing liblber-2.4.so - not both. Since -llber will be the former, and the one you want, you need to deal with whatever is adding the -llber-2.4. Uninstalling whatever provided /usr/lib/amd64/liblber-2.4.so may take care of it.

You might have the same problem with -lldap and -lldap_r-2.4 - I'm not sure what the libldap_r one is but a quick search suggests there will be conflicts with libldap.


Top
 Profile  
 
PostPosted: Tue Sep 05, 2017 12:32 pm 
Offline
Forum Newbie

Joined: Tue Aug 29, 2017 4:20 pm
Posts: 10
Location: Juneau, AK
Back from a long weekend - Thanks for explaining that. It doesn't look like its going to be easy 'pkg uninstall openldap' because of other dependencies.

What I am going to do is spin up a fresh server and compile the libraries myself - (and I'll have to write the documentation to go with it ugh) -- I will let you know how it goes!


Top
 Profile  
 
PostPosted: Tue Sep 05, 2017 5:23 pm 
Offline
Forum Newbie

Joined: Tue Aug 29, 2017 4:20 pm
Posts: 10
Location: Juneau, AK
Ok, so I finally did get it to compile, I built 'cURL' from source and it seemed to work, but now when I run the phpldap example script, php errors out with:

/var/apache/log/error_log:

[Tue Sep 05 14:12:37.221792 2017] [core:notice] [pid 25599] AH00052: child pid 25601 exit signal Segmentation fault (11)'

It does this on 'ldap_connect()' - - I feel I'm right there.


Top
 Profile  
 
PostPosted: Wed Sep 06, 2017 3:04 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6550
Location: WA, USA
You'll have to get a backtrace to (hopefully) locate the source of the problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group