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

I have mongo installed on the server and running, I can query the command line. PHP and Apache are running fine as well. The problem, however, is that isn't in the php lib directory, and I can't find to move it there. sudo find / -name doesn't yield any results. I also can't really find anywhere to download it.

How should I proceed?

share|improve this question
up vote 3 down vote accepted

So, you need the PHP bit to connect to mongo.

You can use PECL to install it by running something like pecl install mongo.

You can also install it more manually by going to

I don't believe Ubuntu (at least 10.04) has a PHP-mongo package, at least not according to aptitude search mongo.


As noted below, the OP needed the build-essential package, which will include things like make, gcc, etc.

share|improve this answer
Turns out I had to install PECL, GCC and MAKE... that was my problem. and sudo apt-get install PECL isn't how you do that, apparently! – kavisiegel Mar 6 '12 at 20:47
Yeah, PECL is just going to download the source for you and compile it. To compile it, you're going to need gcc, make, etc. – cjc Mar 6 '12 at 21:04

Try reading this guide to setup PHP and MongoDB developement environment. This one is for Ubuntu, but it think it should work with others too.

share|improve this answer

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.