Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build with 32-bit compatibility?? #671

Closed
VajiraPrabuddhaka opened this issue Nov 14, 2017 · 9 comments
Closed

How to build with 32-bit compatibility?? #671

VajiraPrabuddhaka opened this issue Nov 14, 2017 · 9 comments

Comments

@VajiraPrabuddhaka
Copy link

VajiraPrabuddhaka commented Nov 14, 2017

In my linux pc I have already installed lampp. So when I build mongodb.so using this instructions, lampp suddenly says

"XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility library for your system"

Can anyone help me to build this with 32-bit compatibility as it suggests??

@derickr
Copy link
Contributor

derickr commented Nov 14, 2017

It seems to e some generic error if PHP can't start. (https://shrinathsuccess.wordpress.com/tag/xampp-is-currently-only-availably-as-32-bit-application-please-use-a-32-bit-compatibility-library-for-your-system/) What does the following output:

/opt/lampp/bin/php -v

There is no problem building the MongoDB extension with a 32-bit PHP at all, but it is possible that you have to run export CFLAGS=-m32 before running ./configure

@VajiraPrabuddhaka
Copy link
Author

VajiraPrabuddhaka commented Nov 14, 2017

@derickr I also done the CFLAGS=-m32 , but still it is not working

Here is the output for /opt/lampp/bin/php -v

PHP Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so: wrong ELF class: ELFCLASS32 in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so: wrong ELF class: ELFCLASS32 in Unknown on line 0
PHP 7.1.9 (cli) (built: Sep 18 2017 02:29:39) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

@derickr
Copy link
Contributor

derickr commented Nov 14, 2017

Heh. That is odd. It indicates it wants a 64-bit binary (ELFCLASS64) and not the ELFCLASS32 that you just built. Can you show the output of the following commands:

file /opt/lampp/bin/php
file /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so

@VajiraPrabuddhaka
Copy link
Author

Now I changed to 64-bit and still getting initial error as in the first comment,

Followings are the outputs for titled commands:

file /opt/lampp/bin/php

/opt/lampp/bin/php: symbolic link to php-7.1.9

file /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so

/opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=b71d583b92c4218566d5711e927c0bb93b14dc4f, with debug_info, not stripped

/opt/lampp/bin/php -v

/opt/lampp/bin/php: relocation error: /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so: symbol SSL_library_init, version OPENSSL_1.0.0 not defined in file libssl.so.1.0.0 with link time reference

@jmikola
Copy link
Member

jmikola commented Nov 14, 2017

file /opt/lampp/bin/php

/opt/lampp/bin/php: symbolic link to php-7.1.9

Can you step through the symlink and run file on the actual binary it points to?

@VajiraPrabuddhaka
Copy link
Author

VajiraPrabuddhaka commented Nov 14, 2017

@jmikola it is pointed to php-7.1.9 binary file in the same directory, here are the details
Command: file /opt/lampp/bin/php-7.1.9
Output:

php-7.1.9: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.9, stripped

@flyneko
Copy link

flyneko commented Mar 23, 2018

@VajiraPrabuddhaka Have you fixed this issue? I have the same error

@VajiraPrabuddhaka
Copy link
Author

VajiraPrabuddhaka commented Mar 23, 2018

@flyneko No, I couldn't fix it, instead I turned to use global apache server installed in linux with global PHP installation for linux, rather than using lampp

@jmikola
Copy link
Member

jmikola commented Oct 2, 2018

Closing this, given the OP worked around the issue by using a standard PHP installation. Ultimately, it seems this was a problem with LAMPP and not the driver's build process.

@jmikola jmikola closed this as completed Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants