Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: *** [] Error 1

The full log can be found at pastbin :

The extension im trying to install is at bitbucket:

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

migrated from Oct 9 '12 at 11:01

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

Just a compiling error not server related issue – msoro Oct 9 '12 at 10:41
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 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

Your Answer


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.