How to Install the MongoDB PHP Module on Ubuntu 14.04 LTS

Installing the PHP module for MongoDB on Ubuntu 14.04 LTS is just a command
away, but first, let’s ensure that we have MongoDB itself installed:

sudo apt-get install mongodb

Once we have MongoDB installed, we can proceed with installing the module.
Please note that you could combine these commands to install MongoDB and the
module in one shot:

sudo apt-get install php5-mongo

Once installed, you will want to restart your web server and/or process manager
(spawncgi, php-fpm, et cetera). Once you’ve done so, you can pull up
phpinfo() and you should see a new section for MongoDB. You are now ready to
interact with MongoDB from your PHP scripts!

Josh Sherman - The Man, The Myth, The Avatar

About Josh

Husband. Father. Pug dad. Musician. Founder of Holiday API, Head of Engineering and Emoji Specialist at Mailshake, and author of the best damn Lorem Ipsum Library for PHP.

If you found this article helpful, please consider buying me a coffee.