Installing Mongodb with Lamp On Ubuntu ( Linux ) Installing Mongodb with Lamp On Ubuntu ( Linux ) mongodb mongodb

Installing Mongodb with Lamp On Ubuntu ( Linux )


This means that your PHP is compiled in 32-bit mode, but the mongo extension as 64-bit mode. I believe Apple's compiled PHP is in 32-bit mode as well, you can verify that with:

php -r 'echo PHP_INT_MAX, "\n";'

If that shows

9223372036854775807
you're on a 64-bit platform.

Now, in your case you will need to make sure that you compile the MongoDB extension with a 32-bit architecture. From http://artur.ejsmont.org/blog/content/how-to-build-mongodb-pecl-extension-in-32bit-for-php-52-on-macosx-snow-leaopard I believe you can do that with:

pecl download mongotar -xvzf mongo-1.2.7.tgzcd mongo-1.2.7CFLAGS="-m32"phpize./configuremakemake install


The problem was as is outlined by Derick above. Although the way the problem got solved was download a 32 bit version of the ubuntu os and running it as a virtual machine on my pc using vmware. Later followed the 'Manual Installation section' on this page for the php driver installation and it all worked. Got the php drivers from github as mentioned in the page.

Later i copied the file mongo.so from the php file extensions directory running on my virtual machine to my parent os and it all works now!