How to Install the MongoDB PHP Module on Ubuntu 14.04 LTS

Josh Sherman
1 min read
Servers PHP NoSQL Debian / Ubuntu
WARNING: The following post talks about an Ubuntu version that is at end of life. It's highly recommended that you upgrade your server to a newer Ubuntu version.

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!

Join the Conversation

Good stuff? Want more?

Weekly emails about technology, development, and sometimes sauerkraut.

100% Fresh, Grade A Content, Never Spam.

Related Articles