CakeFest 2017 NYC, the Official CakePHP Conference

Installing the MongoDB PHP Driver on OSX with Homebrew

If you are using » Homebrew, the PHP tap includes formulae for installing the driver on various PHP versions.

  • php54-mongodb
  • php55-mongodb
  • php56-mongodb
  • php70-mongodb

For example, you might install the driver for PHP 7.0 using the following command:

$ brew install php70-mongodb

add a note add a note

User Contributed Notes 3 notes

givemeanthony at outlook dot com
5 months ago
You must first tap the PHP formula repository from terminal like so

    brew tap homebrew/php

in order to install PHP extensions like MongoDB via Homebrew.
After tapping the formula repository, install the MongoDB extension

    brew install phpxx-mongodb

where xx is the version number.
amit dot clavax at gmail dot com
3 months ago
Below command work for me mac sierra os
brew install php55-mongodb
avtrulzz at yahoo dot co dot in
5 months ago
The correct command for installation is using homebrew is
brew install homebrew/php/phpxx-mongodb

For ex. to install the driver for php5.6 use :
brew install homebrew/php/php55-mongodb
To Top