Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Im trying to install a php extension that is written in c and make use of mongodb c driver. I have been trying for the last 2 days to compile and install the extension however im getting the same error.

 /usr/bin/ld: /usr/local/lib/libmongoc.a(bson.o): relocation R_X86_64_32S against `bson_numstrs' can not be used when making a shared object; recompile with -fPIC
    /usr/local/lib/libmongoc.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    make: *** [thaps.la] Error 1

The full log can be found at pastbin : http://pastebin.com/iqpqHYpm

The extension im trying to install is at bitbucket: https://bitbucket.org/heinep/thaps

Im using php 5.4 with zend 2.4 apache 2.2 mongodb c driver v0.5 ubuntu 12.04 64bits

share|improve this question
    
Just a compiling error not server related issue –  msoro Oct 9 '12 at 10:41
add comment

migrated from stackoverflow.com Oct 9 '12 at 11:01

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 0 down vote accepted

You'll need to install the MongoDB server, not the driver. Also install the mongodb-dev package, as additional development headers/files may be needed. If you need additional help; documents at mongodb.org offer detailed instructions for installing on Ubuntu & PHP driver.

sh ~> sudo apt-get install mongodb-server mongodb-dev
sh ~> sudo pecl install mongo

php5-mongo is also available through Ubuntu's package manager.

sh ~> sudo apt-get install php5-mongo
share|improve this answer
    
Thank you :)... this solved the problem... –  mrs Oct 12 '12 at 12:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.