The MongoDB server will be automatically launched at startup. You can stop reading now if all you need is MongoDB and don't plan to use PHP with it. Type in a Terminal window: sudo launchctl load /Library/LaunchDaemons/ Put this in a new file at /Library/LaunchDaemons/. Put this in a new file at /etc/nf: # This is an example config file for MongoDB.Ĭonfigure a launchd LaunchDaemon. But there's lots more to do to get it working.Ĭreate directories required by MongoDB. Open a Terminal, ensure you're using an account with Administrator privileges, and type: sudo port install mongodb MacPorts ensures dependencies are installed correctly, and provides an easy way to upgrade all outdated packages at once.
DOWNLOAD MONGODB PHP EXT FOR MAC OS X
MacPorts is a package manager for Mac OS X that makes it easy to install and configure a lot of open-source software.Īlthough MongoDB binaries are available from the MongoDB web site, I strongly recommend using the MacPorts MongoDB port. If you already have a component installed, simply skip that step. This tutorial assumes a virgin Mac OS X installation.
DOWNLOAD MONGODB PHP EXT HOW TO
I read a lot of conflicting instructions on the Web about how to install MongoDB, and they're either incomplete (most of them skip the part about making MongoDB run automatically at startup), and none of them satisfied the following requirements I had: The steps outlined here ensure that your MongoDB installation integrates well with the rest of the system (Apache, PHP & launchd), is started automatically when the machine starts up, and makes it easy to upgrade later. These instructions work for 10.7 Lion, 10.6 Snow Leopard and 10.5 Leopard. For various ongoing pet projects, I figured I'd give it a try to avoid the overhead of creating/maintaining schemas and having to flatten down my JSON objects to fit a relational model. MongoDB is a document-oriented database (among other things), and it's especially convenient that the native document format is JSON. Home → Blog → HOWTO Install MongoDB for PHP on Mac OS X HOWTO Install MongoDB for PHP on Mac OS X