1

I have a 64bit linux EC2 instance which comes with pre installed php.

However I needed xammp so I installed a 32 bit XAMPP. Everything works fine.

I installed mongodb which also works fine.

Now I needed to install a pecl php extention of mongo so that my webapp can run properly.

For this I figured out that a 32bit mongo.sa is required since my php in XAMPP is 32 bit therefore I followed this post : Installing Mongodb with Lamp On Ubuntu ( Linux )

The problem is, the mongo.so being generated even after setting CFALGS="-m32" is still 64 bit :(.

Where am I going wrong?

This is what I did to install the mongo extension

/opt/lampp/bin/pecl download mongo
tar xvzf mongo-1.2.12.tgz
cd mongodb-1.2.12
CFLAGS="-m32"
sudo /opt/lampp/bin/phpize 
./configure
make
cd modules
ls ( gives mongo.so)
file mongo.so ( still shows its ELF64 bit extension)

mongo.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped

:(. Please help!

Community
  • 1
  • 1
Vikas Singh
  • 1,781
  • 7
  • 27
  • 54

1 Answers1

0

Instead of the plain make step, try make CFLAGS="-m32".

linux-1:/tmp/mongo-1.2.12$ file modules/mongo.so
modules/mongo.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=0x37bbd16cd2928f1b8e86be001d6604046945d9f1, not stripped
slee
  • 524
  • 2
  • 6